Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / gcc.c-torture / compile / 981006-1.c
blob718fa881af5e5bd775173f395448bf55ddc047c0
1 /* Test that tablejump insns are correctly handled. If the compiler
2 loses track of the jump targets, it will report that x and y can be
3 used uninitialized.
5 This is broken in egcs 1998/10/06 for mips in pic mode. */
6 /* { dg-do assemble } */
7 /* For MIPS at least, pic is needed to trigger the problem. */
8 /* { dg-options "-w -Wuninitialized -Werror -fpic" } */
9 /* { dg-options "-w -Wuninitialized -Werror" { target rs6000-*-aix* powerpc*-*-aix* arm*-*-* xscale*-*-* strongarm*-*-* fr30-*-* sh-*-hms sh-*-coff h8300*-*-* cris-*-elf* cris-*-aout* mmix-*-* } } */
11 int foo (int a, int b)
13 __label__ z;
14 int x; /* { dg-bogus "warning: `.' might be used uninitialized in this function" } */
15 int y; /* { dg-bogus "warning: `.' might be used uninitialized in this function" } */
16 static void *p;
18 switch (a) {
19 case 2:
20 x = 4;
21 break;
22 case 4:
23 x = 6;
24 break;
25 case 8: case 10: case 13: case 11: case 17: case 19:
26 x = 7;
27 break;
28 default:
29 x = -1;
30 break;
32 switch (b) {
33 case 2:
34 y = 4;
35 break;
36 case 4:
37 y = 6;
38 break;
39 case 8: case 10: case 13: case 11: case 17: case 19:
40 y = 7;
41 break;
42 default:
43 y = -1;
44 break;
47 p = &&z;
48 return x * y;
50 int main (int argc, char *argv[])
52 return 1 == foo (argc, argc + 1);