Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr71785.c
blob613dcd1a937f673dcd651a3b8fb1d58f589ed2d4
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-options "-O2" } */
3 /* { dg-final { scan-assembler-not {\mb\M} } } */
5 /* Check that all computed gotos in this testcase end up unfactored completely.
6 If some is not there will be a unconditional jump left; if all works fine,
7 all are gone. */
9 typedef enum opcode
11 OP_A,
12 OP_B,
13 OP_END
14 } opcode;
16 typedef struct op
18 opcode opcode;
19 int arg;
20 } op;
22 extern void do_stuff_b(int arg);
23 extern void do_stuff_c(int arg);
25 extern int someglobal;
27 void
28 eval(op *op)
30 static const void *dispatch_table[] = {
31 &&CASE_OP_A,
32 &&CASE_OP_B,
33 &&CASE_OP_C,
34 &&CASE_OP_END
37 goto *dispatch_table[op->opcode];
38 CASE_OP_A:
39 someglobal++;
40 op++;
41 goto *dispatch_table[op->opcode];
42 CASE_OP_B:
43 do_stuff_b(op->arg);
44 op++;
45 goto *dispatch_table[op->opcode];
46 CASE_OP_C:
47 do_stuff_c(op->arg);
48 op++;
49 goto *dispatch_table[op->opcode];
50 CASE_OP_END:
51 return;