| 1 |
// Origin PR debug/ |
| 2 |
// { dg-options "-gdwarf-2 -dA -gno-column-info" } |
| 3 |
|
| 4 |
class C { |
| 5 |
public: |
| 6 |
C() {} |
| 7 |
~C() {} |
| 8 |
}; |
| 9 |
typedef struct { |
| 10 |
C m; |
| 11 |
} t; |
| 12 |
typedef t s; |
| 13 |
s v; |
| 14 |
|
| 15 |
/* |
| 16 |
We want to check that we have a DIE describing the typedef t like this: |
| 17 |
|
| 18 |
.uleb128 0xc # (DIE (0xb8) DW_TAG_typedef) |
| 19 |
.ascii "t\0" # DW_AT_name |
| 20 |
.byte 0x1 # DW_AT_decl_file (../../prtests/test.cc) |
| 21 |
.byte 0xb # DW_AT_decl_line |
| 22 |
.long 0x78 # DW_AT_type |
| 23 |
|
| 24 |
e.g, it should not haven any child DIE -- the bug here was that this |
| 25 |
DIE had children DIEs. So we check that the last line is immediately |
| 26 |
followed by a line containing the pattern "(DIE (", instead of a |
| 27 |
line containing a DW_AT_sibling attribute. |
| 28 |
*/ |
| 29 |
|
| 30 |
// { dg-final { scan-assembler-times "\[^\n\r\]*\\(DIE \[^\n\r\]* DW_TAG_typedef\\)\[\n\r\]{1,2}\[^\n\r\].*\"t\\\\0\"\[^\n\r\]*DW_AT_name\[\n\r\]{1,2}\[^\n\r\]*\[\n\r\]{1,2}\[^\n\r\]*\[\n\r\]{1,2}\[^\n\r\]*DW_AT_type\[\n\r\]{1,2}\[^\n\r\]*\\(DIE" 1 } } |