blob: f3b120bb4588d79378ebf5d330512571d382711e [file] [log] [blame]
/* Test BTF generation of anonymous union.
We expect a named struct type and an anonymous union type record to
be generated. The anonymous union record should have a name of 0,
pointing to the null string at the start of the string table. */
/* { dg-do compile } */
/* { dg-options "-O0 -gbtf -dA" } */
/* Struct type with 1 member. */
/* { dg-final { scan-assembler-times "\[\t \]0x4000001\[\t \]+\[^\n\]*btt_info" 1 } } */
/* Union type with 2 members. */
/* { dg-final { scan-assembler-times "\[\t \]0x5000002\[\t \]+\[^\n\]*btt_info" 1 } } */
/* { dg-final { scan-assembler-times "\[\t \]0\[\t \]+\[^\n\]*btt_name" 1 } } */
struct foo
{
union
{
int value;
char ascii;
};
} myfoo;