struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-loop-3c.c
blob5cbfa3c4ad2d09bebbd40012d3573e266c0d7ed9
1 /*
2 loop-4c.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 #include <limits.h>
13 #if (!defined(__SDCC_mcs51) || defined(__SDCC_MODEL_LARGE) || defined(__SDCC_MODEL_HUGE)) && !defined(__SDCC_pdk13) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
14 void * a[255];
16 void f (int m)
18 int i;
19 int sh = 0x100;
20 i = m;
23 a[sh >>= 1] = ((unsigned)i << 3) + (char*)a;
24 i += 4;
26 while (i < INT_MAX/2 + 1 + 4 * 4);
28 #endif
30 void
31 testTortureExecute (void)
33 #if (!defined(__SDCC_mcs51) || defined(__SDCC_MODEL_LARGE) || defined(__SDCC_MODEL_HUGE)) && !defined(__SDCC_pdk13) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
34 a[0x10] = 0;
35 a[0x08] = 0;
36 f (INT_MAX/2 + INT_MAX/4 + 2);
37 if (a[0x10] || a[0x08])
38 ASSERT (0);
39 a[0x10] = 0;
40 a[0x08] = 0;
41 f (INT_MAX/2 + 1);
42 if (! a[0x10] || a[0x08])
43 ASSERT (0);
44 #endif
45 return;