OSDN Git Service

Backported from mainline
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / execute / 20011219-1.c
1 /* This testcase failed on IA-32 at -O and above, because combine attached
2    a REG_LABEL note to jump instruction already using JUMP_LABEL.  */
3
4 extern void abort (void);
5 extern void exit (int);
6
7 enum X { A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q };
8
9 void
10 bar (const char *x, int y, const char *z)
11 {
12 }
13
14 long
15 foo (enum X x, const void *y)
16 {
17   long a;
18
19   switch (x)
20     {
21     case K:
22       a = *(long *)y;
23       break;
24     case L:
25       a = *(long *)y;
26       break;
27     case M:
28       a = *(long *)y;
29       break;
30     case N:
31       a = *(long *)y;
32       break;
33     case O:
34       a = *(long *)y;
35       break;
36     default:
37       bar ("foo", 1, "bar");
38     }
39   return a;
40 }
41
42 int
43 main ()
44 {
45   long i = 24;
46   if (foo (N, &i) != 24)
47     abort ();
48   exit (0);
49 }