struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20000422-1.c
blob4cd786fb185f96202c4c33ad1bce1bf97141b153
1 /*
2 20000422-1.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 #if !defined(__SDCC_pdk14) // Lack of memory
12 int ops[13] =
14 11, 12, 46, 3, 2, 2, 3, 2, 1, 3, 2, 1, 2
17 int correct[13] =
19 46, 12, 11, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1
21 #endif
23 int num = 13;
25 void
26 testTortureExecute (void)
28 #if !defined(__SDCC_pdk14) // Lack of memory
29 int i;
31 for (i = 0; i < num; i++)
33 int j;
35 for (j = num - 1; j > i; j--)
37 if (ops[j-1] < ops[j])
39 int op = ops[j];
40 ops[j] = ops[j-1];
41 ops[j-1] = op;
47 for (i = 0; i < num; i++)
48 if (ops[i] != correct[i])
49 ASSERT (0);
51 return;
52 #endif