struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20011219-1.c
bloba615f6dcb626bb02531ad31377c4a9da68815bd0
1 /*
2 20011219-1.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #pragma disable_warning 85
10 #pragma disable_warning 84
11 #endif
13 /* This testcase failed on IA-32 at -O and above, because combine attached
14 a REG_LABEL note to jump instruction already using JUMP_LABEL. */
16 enum X { A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q };
18 void
19 bar (const char *x, int y, const char *z)
23 long
24 foo (enum X x, const void *y)
26 long a;
28 switch (x)
30 case K:
31 a = *(long *)y;
32 break;
33 case L:
34 a = *(long *)y;
35 break;
36 case M:
37 a = *(long *)y;
38 break;
39 case N:
40 a = *(long *)y;
41 break;
42 case O:
43 a = *(long *)y;
44 break;
45 default:
46 bar ("foo", 1, "bar");
48 return a;
51 void
52 testTortureExecute (void)
54 long i = 24;
55 if (foo (N, &i) != 24)
56 ASSERT (0);
57 return;