1 /* Contributed by Dodji Seketeli <dodji@redhat.com>
4 Abstract instances (DW_TAG_subroutines having the DW_AT_inline attribute)
5 of second and first were having a DW_TAG_lexical_block DIE wrongly
6 representing the inlined calls to third (in second) and to
7 second (in first). At the same time, main didn't have children
8 DW_TAG_inlined_subroutine DIEs representing the inlined calls to
9 first, second and third.
11 The ideal goal here is to test that we have no superfluous
12 DW_TAG_lexical_block DIE anymore, that abstract instances DIEs have
13 no descendant DIE with a DW_AT_abstract_origin attribute, and that main has
14 properly nested DW_TAG_inlined_subroutine DIEs for third, second and first.
17 /* { dg-options "-O -g3 -dA" } */
18 /* { dg-do compile } */
20 /* There are 6 inlined subroutines:
21 - One for each subroutine inlined into main, that's 3.
22 - One for earch subroutine inline into the out of line instances
23 of third, second and first. */
24 /* { dg-final { scan-assembler-times "\\(DIE \\(.*?\\) DW_TAG_inlined_subroutine" 6 } } */
26 /* Likewise we should have 6 DW_TAG_lexical_block DIEs:
27 - One for each subroutine inlined into main, so that's 3.
28 - One for each subroutine inlined in the out of line instances
29 of third, second and first, that's 3.
31 /* { dg-final { scan-assembler-times "\\(DIE \\(.*?\\) DW_TAG_lexical_block" 6 } } */
34 /* There are 3 DW_AT_inline attributes: one per abstract inline instance.
35 The value of the attribute must be 0x3, meaning the function was
37 /* { dg-final { scan-assembler-times "(?:byte|data1)\[^\n\]*0x3\[^\n\]* DW_AT_inline" 3 } } */