1 /*
2 20011219-1.c from the execute part of the gcc torture tests.
3 */
4
5 #include <testfwk.h>
6
7 #ifdef __SDCC
8 #pragma std_c99
9 #pragma disable_warning 85
10 #pragma disable_warning 84
11 #endif
12
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. */
15
16 enum X { A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q };
17
18 void
bar(const char * x,int y,const char * z)19 bar (const char *x, int y, const char *z)
20 {
21 }
22
23 long
foo(enum X x,const void * y)24 foo (enum X x, const void *y)
25 {
26 long a;
27
28 switch (x)
29 {
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");
47 }
48 return a;
49 }
50
51 void
testTortureExecute(void)52 testTortureExecute (void)
53 {
54 long i = 24;
55 if (foo (N, &i) != 24)
56 ASSERT (0);
57 return;
58 }
59
60