1 /* Verify that the concrete instance DW_TAG_lexical_block has an abstract
2 origin. Verify that the inline instance has the abstract instance as
3 abstract origin rather than the concrete one. */
4 /* { dg-options "-O -gdwarf -dA" } */
5 /* { dg-do compile } */
6 /* { dg-final { scan-assembler-times "DW_TAG_inlined_subroutine" 2 } } */
7 /* { dg-final { scan-assembler-times "DW_TAG_lexical_block\\)\[^#/!@;\\|\]*\[#/!@;\\|\]+ +DW_AT_abstract_origin" 2 } } */
8 /* { dg-final { scan-assembler-times "DW_TAG_lexical_block\\)\[^#/!@;\\|\]*\[#/!@;\\|\]+ +\[^#/!@\\|\]*\\(DIE \\(0x\[0-9a-f\]*\\) DW_TAG_variable" 1 { xfail hppa*-*-* } } } */
9 /* We do not know which is output first so look for both invalid abstract
10 origins on the lexical blocks (knowing that the abstract instance has
11 no attribute following the DW_TAG_lexical_block. */
12 /* { dg-final { scan-assembler-not "\\(DIE \\(0x(\[0-9a-f\]*)\\) DW_TAG_lexical_block\\)\[^#/!@;\\|\]*\[#/!@;\\|\]+ +DW_AT.*DW_TAG_lexical_block\\)\[^#/!@;\\|x\]*x\\1\[^#/!@;\\|\]*\[#/!@;\\|\] +DW_AT_abstract_origin" { xfail { { *-*-aix* || *-*-solaris2.* } && { ! gas } } } } } */
13 /* { dg-final { scan-assembler-not "DW_TAG_lexical_block\\)\[^#/!@;\\|x\]*x(\[0-9a-f\]*)\[^#/!@;\\|\]*\[#/!@;\\|\]+ +DW_AT_abstract_origin.*\\(DIE \\(0x\\1\\) DW_TAG_lexical_block\\)\[^#/!@;\\|\]*\[#/!@;\\|\]+ +DW_AT" } } */
14
foo(int i)15 int foo (int i)
16 {
17 {
18 volatile int j = i + 3;
19 return j - 2;
20 }
21 }
main()22 int main()
23 {
24 volatile int z = foo (-1);
25 return z;
26 }
27