struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20050224-1.c
blobba4446ee0b5d05201d60ac75977f02e3da8a7e2a
1 /*
2 20050224-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 /* Origin: Mikael Pettersson <mikpe@csd.uu.se> and the Linux kernel. */
13 unsigned long a = 0xc0000000, b = 0xc0400000;
14 unsigned long c = 0xc01bb958, d = 0xc0264000;
15 unsigned long e = 0xc0288000, f = 0xc02d4378;
17 void
18 foo (int x, int y, int z)
20 ASSERT (!(x != 245 || y != 36 || z != 444));
23 void
24 testTortureExecute (void)
26 unsigned long g;
27 int h = 0, i = 0, j = 0;
29 ASSERT (!(sizeof (unsigned long) < 4));
31 for (g = a; g < b; g += 0x1000)
32 if (g < c)
33 h++;
34 else if (g >= d && g < e)
35 j++;
36 else if (g < f)
37 i++;
38 foo (i, j, h);