Debian Codegraph @

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

raw
1 /* Test BTF generation of anonymous union.
2
3 We expect a named struct type and an anonymous union type record to
4 be generated. The anonymous union record should have a name of 0,
5 pointing to the null string at the start of the string table. */
6
7 /* { dg-do compile } */
8 /* { dg-options "-O0 -gbtf -dA" } */
9
10 /* Struct type with 1 member. */
11 /* { dg-final { scan-assembler-times "\[\t \]0x4000001\[\t \]+\[^\n\]*btt_info" 1 } } */
12 /* Anonymous union type with 2 members. */
13 /* { dg-final { scan-assembler-times "\[\t \]0x5000002\[\t \]+\[^\n\]*btt_info" 1 } } */
14 /* { dg-final { scan-assembler-times " BTF_KIND_UNION ''" 1 } } */
15
16 struct foo
17 {
18 union
19 {
20 int value;
21 char ascii;
22 };
23 } myfoo;