aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/debug/ctf/ctf-struct-2.c
blob: 09b4d2f8f789d6c44a4e3f7b49609a2be3abffc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* Test for compilation of self-referntial structs.

   Further, the compiler is expected to generate a single CTF struct type for
   struct dmx_dtdef (due to Type de-duplication at CTF generation).  */

/* { dg-do compile )  */
/* { dg-options "-O0 -gctf -dA" } */
/* { dg-final { scan-assembler-times "ascii \"dmx_dtdef.0\"\[\t \]+\[^\n\]*ctf_string" 1 } } */
/* { dg-final { scan-assembler-times "ascii \"dtd_name.0\"\[\t \]+\[^\n\]*ctf_string" 1 } } */
/* { dg-final { scan-assembler-times "ascii \"dtd_type.0\"\[\t \]+\[^\n\]*ctf_string" 1 } } */
/* { dg-final { scan-assembler-times "ascii \"dmx_dtdef_t.0\"\[\t \]+\[^\n\]*ctf_string" 1 } } */

struct link
{
  struct link * next;
} * s_link;

typedef long dmx_id_t;

typedef struct dmx_dtdef
{
  char * dtd_name;
  dmx_id_t dtd_type;
} dmx_dtdef_t;

typedef struct dmx_bundle
{
  dmx_id_t dmb_type;
  dmx_dtdef_t * dmb_dtd;
} dmx_bundle_t;

dmx_bundle_t dbt;