struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-2643.c
blob14f6bba55b820a3fa6f1b0e939fa4ed93bb54f4a
1 /*
2 bug-2643.c
3 */
5 #include <testfwk.h>
7 struct S { int a; union { int b; int c; }; };
9 struct S x = { 1, { 2 } };
10 struct S y = { 5, { 6 } };
11 struct S z = { 7, { .c = 8 } };
13 void testBug(void)
15 ASSERT (x.a == 1);
16 ASSERT (x.b == 2);
17 ASSERT (y.a == 5);
18 ASSERT (y.b == 6);
19 ASSERT (z.a == 7);
20 ASSERT (z.c == 8);