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-20060412-1.c
blobe42fe8d13c0f293774916516cc452c71e80a5321
1 /*
2 20060412-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 #if !defined(__SDCC_mcs51) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
12 struct S
14 long o;
17 struct T
19 long o;
20 struct S m[82];
23 struct T t;
24 #endif
26 void
27 testTortureExecute (void)
29 #if !defined(__SDCC_mcs51) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
30 struct S *p, *q;
32 p = (struct S *) &t;
33 p = &((struct T *) p)->m[0];
34 q = p + 82;
35 while (--q > p)
36 q->o = -1;
37 q->o = 0;
39 if (q > p)
40 ASSERT (0);
41 if (q - p > 0)
42 ASSERT (0);
43 return;
44 #endif