aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/anon.c
blob: ca86ce5c9c8c9693b6d86e24794b347a5bcb82b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* Test of anonymous union in a struct.  */

#include <string.h>

struct outer
{
  int one;
  int two;

  struct
  {
    union {
      int three : 3;
      int four : 4;
    };

    union {
      int five : 3;
      int six : 4;
    };
  } data;
};

int main ()
{
  struct outer val;

  memset (&val, 0, sizeof (val));
  val.data.six = 6;

  return 0;			/* break here */
}