PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / anon-struct-10.c
blobe212317ea3f72f141355faef61b30f85cda8b686
1 /* Test for designated initializers for anonymous structures and
2 unions. PR 10676. */
3 /* { dg-do run } */
4 /* { dg-options "" } */
6 extern void abort (void);
7 extern void exit (int);
9 struct s
11 int a;
12 struct
14 int b;
15 int c;
17 union
19 int d;
20 struct
22 int e;
25 struct
27 struct
29 struct
31 int f;
37 struct s x =
39 .e = 5,
40 .b = 4,
41 .a = 3,
42 .f = 7,
43 .c = 9
46 int
47 main (void)
49 if (x.a != 3
50 || x.b != 4
51 || x.c != 9
52 || x.d != 5
53 || x.e != 5
54 || x.f != 7)
55 abort ();
56 exit (0);