| 1 |
/* Test compilation and CTF generation of anonymous structs. An anonymous |
| 2 |
struct type is encoded as no-name CTF struct type. |
| 3 |
|
| 4 |
For this testcase, a single CTF anonymous struct is expected. |
| 5 |
struct {} : ctt_name = 0 (point to offset 0 in the CTF string table to |
| 6 |
denote empty string) |
| 7 |
|
| 8 |
Two CTF struct records should be generated in total. |
| 9 |
struct a : ctt_info = 0x1a000002 (2 fields) |
| 10 |
struct {} : ctt_info = 0x1a000001 (1 field) */ |
| 11 |
|
| 12 |
/* { dg-do compile } */ |
| 13 |
/* { dg-options "-O0 -gctf -dA" } */ |
| 14 |
|
| 15 |
/* { dg-final { scan-assembler-times "\[\t \]0\[\t \]+\[^\n\]*ctt_name" 1 } } */ |
| 16 |
/* { dg-final { scan-assembler-times "0x1a000002\[\t \]+\[^\n\]*ctt_info" 1 } } */ |
| 17 |
/* { dg-final { scan-assembler-times "0x1a000001\[\t \]+\[^\n\]*ctt_info" 1 } } */ |
| 18 |
|
| 19 |
struct a |
| 20 |
{ |
| 21 |
struct { int b1; } a1; |
| 22 |
int a2; |
| 23 |
} my_a; |