Merged revisions 208012,208018-208019,208021,208023-208030,208033,208037,208040-20804...
[official-gcc.git] / main / gcc / testsuite / g++.dg / debug / dwarf2 / auto1.C
blobaef29ee5d958390a1485ce5989492145baf2276d
1 // PR c++/53756
2 // { dg-do compile { target c++1y } }
3 // { dg-options "-g -dA -fno-debug-types-section" }
4 // We're looking for something like
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 0x7    # (DIE (0x57) DW_TAG_subprogram)
14 // .long   0x33    # DW_AT_specification
15 // .long   0x87    # DW_AT_type
16 //...
17 // .uleb128 0x9    # (DIE (0x87) DW_TAG_base_type)
18 // .ascii "int\0"  # DW_AT_name
20 // { dg-final { scan-assembler "a1.*(0x\[0-9a-f]+)\[^\n\r]*DW_AT_type.*\\1. DW_TAG_unspecified_type.*DW_AT_specification\[\n\r]{1,2}\[^\n\r]*(0x\[0-9a-f]+)\[^\n\r]*DW_AT_type.*\\2. DW_TAG_base_type" } }
22 struct A
24   auto a1 () { return 42; }
27 int main()
29   A a;
30   a.a1();