struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20060905-1.c
blob4fd19f5a7392c20f5a36d3430f7728c381a659a1
1 /*
2 20060905-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 /* PR rtl-optimization/28386 */
13 /* Origin: Volker Reichelt <reichelt@gcc.gnu.org> */
15 volatile char s[256][3];
17 char g;
19 static void dummy(char a)
21 g = a;
24 static int foo(void)
26 int i, j=0;
28 for (i = 0; i < 256; i++)
29 if (i >= 128 && i < 256)
31 dummy (s[i - 128][0]);
32 ++j;
35 return j;
37 #endif
39 void testTortureExecute(void)
41 #if !defined(__SDCC_mcs51) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
42 if (foo () != 128)
43 ASSERT (0);
45 return;
46 #endif