Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-931102-2.c
blobd5cd6ba4126559fecdf48de69e2f2a8712a693fd
1 /*
2 931102-2.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 long align;
14 struct
16 short h, l;
17 } b;
18 } T;
20 int f (int x)
22 int num = 0;
23 T reg;
25 reg.b.l = x;
26 while ((reg.b.l & 1) == 0)
28 num++;
29 reg.b.l >>= 1;
31 return num;
34 void
35 testTortureExecute (void)
37 if (f (2) != 1)
38 ASSERT (0);
39 return;