aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/debug/ctf/ctf-anonymous-struct-1.c
blob: 93547d458186cf2edc6ca7fa37cbf833c33156ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* Test compilation and CTF generation of anonymous structs.  An anonymous
   struct type is encoded as no-name CTF struct type.

   For this testcase, a single CTF anonymous struct is expected.
   struct {} : ctt_name = 0 (point to offset 0 in the CTF string table to
			    denote empty string)
   
   Two CTF struct records should be generated in total.
   struct a : ctt_info = 0x1a000002 (2 fields)
   struct {} : ctt_info = 0x1a000001 (1 field)  */

/* { dg-do compile )  */
/* { dg-options "-O0 -gctf -dA" } */

/* { dg-final { scan-assembler-times "\[\t \]0\[\t \]+\[^\n\]*ctt_name" 1 } } */
/* { dg-final { scan-assembler-times "0x1a000002\[\t \]+\[^\n\]*ctt_info" 1 } } */
/* { dg-final { scan-assembler-times "0x1a000001\[\t \]+\[^\n\]*ctt_info" 1 } } */

struct a
{
  struct { int b1; } a1;
  int a2;
} my_a;