struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-930208-1.c
blob61fcb2dacc801953763a225ede39ac17263845a6
1 /*
2 930208-1.c from the execute part of the gcc torture suite.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 // TODO: Enable when sdcc supports union!
12 #if 0
13 typedef union {
14 long l;
15 struct { char b3, b2, b1, b0; } c;
16 } T;
18 f (T u)
20 ++u.c.b0;
21 ++u.c.b3;
22 return (u.c.b1 != 2 || u.c.b2 != 2);
24 #endif
26 void
27 testTortureExecute (void)
29 #if 0
30 T u;
31 u.c.b1 = 2;
32 u.c.b2 = 2;
33 u.c.b0 = ~0;
34 u.c.b3 = ~0;
35 if (f (u))
36 ASSERT(0);
37 return;
38 #endif