Debian Codegraph @

gcc/testsuite/gcc.dg/debug/btf/btf-anonymous-struct-1.c

raw
1 /* Test BTF generation of anonymous struct.
2
3 We expect two BTF struct records:
4 - struct foo, with two fields "a" and "bar"
5 - struct <anonymous> with one field "b"
6
7 The anonymous struct should have a name of 0, pointing to the null string
8 at the start of the string table. */
9
10 /* { dg-do compile } */
11 /* { dg-options "-O0 -gbtf -dA" } */
12
13 /* Struct type with 2 members (struct foo). */
14 /* { dg-final { scan-assembler-times " BTF_KIND_STRUCT 'foo'" 1 } } */
15 /* { dg-final { scan-assembler-times "\[\t \]0x4000002\[\t \]+\[^\n\]*btt_info" 1 } } */
16 /* Struct type with 1 member (anon struct). */
17 /* { dg-final { scan-assembler-times " BTF_KIND_STRUCT ''" 1 } } */
18 /* { dg-final { scan-assembler-times "\[\t \]0x4000001\[\t \]+\[^\n\]*btt_info" 1 } } */
19
20 struct foo
21 {
22 int a;
23 struct { int b; } bar;
24 } myfoo;