struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-931102-1.c
blob8aacb0d4fc0b577f579e1f45da088f65c6852173
1 /*
2 931102-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 typedef union
13 struct
15 char h, l;
16 } b;
17 } T;
19 int f (int x)
21 int num = 0;
22 T reg;
24 reg.b.l = x;
25 while ((reg.b.l & 1) == 0)
27 num++;
28 reg.b.l >>= 1;
30 return num;
33 void
34 testTortureExecute (void)
36 if (f (2) != 1)
37 ASSERT (0);
38 return;