aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/debug/btf/btf-anonymous-union-1.c
blob: 49cdc87cf59b18b017803334e7cef844e17d5a0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* 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 } } */
/* Anonymous union type with 2 members.  */
/* { dg-final { scan-assembler-times "\[\t \]0x5000002\[\t \]+\[^\n\]*btt_info" 1 } } */
/* { dg-final { scan-assembler-times " BTF_KIND_UNION ''" 1 } } */

struct foo
{
  union
    {
      int value;
      char ascii;
    };
} myfoo;