Apparently due to slightly different optimization levels
not always both subroutines have multiple subranges,
but having at least one such, and no lexical blocks
is sufficient to prove that the fix worked.  Q.E.D.
So reduce the test expectations to only at least one
inlined subroutine with multiple subranges.

gcc/testsuite/ChangeLog:

        PR 116462
        * gcc.dg/debug/dwarf2/inline7.c: Reduce test expectations.
---
 gcc/testsuite/gcc.dg/debug/dwarf2/inline7.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

fix was confirmed by reporter, OK for trunk?

diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/inline7.c 
b/gcc/testsuite/gcc.dg/debug/dwarf2/inline7.c
index 48d457216b1..083df5b586c 100644
--- a/gcc/testsuite/gcc.dg/debug/dwarf2/inline7.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/inline7.c
@@ -1,9 +1,9 @@
-/* Verify that both inline instances have a DW_AT_ranges but
-   no extra DW_TAG_lexical_block.  */
+/* Verify that at least one of both inline instances have
+   a DW_AT_ranges but no extra DW_TAG_lexical_block.  */
 /* { dg-options "-O -gdwarf -dA" } */
 /* { dg-do compile } */
 /* { dg-final { scan-assembler-times "\\(DIE \\(\[^\n\]*\\) 
DW_TAG_inlined_subroutine" 2 } } */
-/* { dg-final { scan-assembler-times " DW_AT_ranges" 2 } } */
+/* { dg-final { scan-assembler " DW_AT_ranges" } } */
 /* { dg-final { scan-assembler-times "\\(DIE \\(\[^\n\]*\\) 
DW_TAG_lexical_block" 0 } } */
 
 static int foo (int i)
-- 
2.39.2

Reply via email to