Debian Codegraph @

gcc/testsuite/gcc.dg/debug/ctf/ctf-typedef-struct-3.c

raw
1 /* Test CTF generation for a typedef instantiation with CVR quals.
2
3 Caveat: There is no direct way to test that the type of foo is
4 "const my_int_t" via scanning the assembly. This test instead
5 checks for the presence of some of the CTF constructs involved
6 individually. Specifically, it checks for CTF const record and
7 CTF typedef record.
8
9 Variables:
10 foo -> 4: const my_int_t (size 0x8) -> 3: my_int_t (size 0x8) -> 1: struct my_int (size 0x8)
11
12 Types:
13 1: struct my_int (size 0x8)
14 2: int (size 0x4)
15 3: my_int_t (size 0x8) -> 1: struct my_int (size 0x8)
16 4: const my_int_t (size 0x8) -> 3: my_int_t (size 0x8) -> 1: struct my_int (size 0x8)
17 */
18
19 /* { dg-do compile } */
20 /* { dg-options "-O0 -gctf -dA" } */
21
22 /* { dg-final { scan-assembler-times "\[\t \]0x4\[\t \]+\[^\n\]*ctv_typeidx" 1 } } */
23 /* { dg-final { scan-assembler-times "\[\t \]0x2a000000\[\t \]+\[^\n\]*ctt_info" 1 } } */
24 /* { dg-final { scan-assembler-times "\[\t \]0x32000000\[\t \]+\[^\n\]*ctt_info" 1 } } */
25
26 typedef struct my_int
27 {
28 int upper;
29 int lower;
30 } my_int_t;
31
32 const my_int_t foo = {10, 20};