Debian Codegraph @

gcc/testsuite/gcc.dg/debug/ctf/ctf-struct-pointer-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O0 -gctf -dA" } */
3
4 /* This tests the following scenario:
5
6 1. struct foo;
7 2. struct foo *a_foo;
8 3. struct foo { int bar; };
9 4. void baz (struct foo *f) { f->bar = 0; }
10
11 At 2. a forward for struct foo is generated and at 3. the struct
12 type is fully defined. When a pointer to foo is encountered at 4.,
13 an additional CTF type for the completed struct shall be emitted as
14 well. The linker will deduplicate both types. */
15
16 struct foo;
17 struct foo *a_foo;
18 struct foo { int bar; };
19 void baz (struct foo *f) { f->bar = 0; }
20
21 /* { dg-final { scan-assembler-times "\[\t \]\"bar.0\"\[\t \]+\[^\n\]*ctf_string" 1 } } */