Debian Codegraph @

gcc/testsuite/g++.dg/debug/dwarf2/auto1.C

raw
1 // PR c++/53756
2 // { dg-do compile { target c++14 } }
3 // { dg-options "-gdwarf-2 -dA -fno-debug-types-section -fno-inline" }
4 // We're looking for something like
5
6 // .uleb128 0x3 # (DIE (0x33) DW_TAG_subprogram)
7 // .ascii "a1\0" # DW_AT_name
8 // .long 0x4c # DW_AT_type
9 //...
10 // .uleb128 0x5 # (DIE (0x4c) DW_TAG_unspecified_type)
11 // .long .LASF6 # DW_AT_name: "auto"
12 //...
13 // .uleb128 0x9 # (DIE (0x87) DW_TAG_base_type)
14 // .ascii "int\0" # DW_AT_name
15 //...
16 // .uleb128 0x7 # (DIE (0x57) DW_TAG_subprogram)
17 // .long 0x33 # DW_AT_specification
18 // .long 0x87 # DW_AT_type
19
20 // { dg-final { scan-assembler "a1.*(0x\[0-9a-f]+)\[^\n\r]*DW_AT_type.*\\1. DW_TAG_unspecified_type.*(0x\[0-9a-f]+). DW_TAG_base_type.*DW_AT_specification\[\n\r]{1,2}\[^\n\r]*\\2\[^\n\r]*DW_AT_type" } }
21
22 struct A
23 {
24 auto a1 () { return 42; }
25 };
26
27 int main()
28 {
29 A a;
30 a.a1();
31 }