FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / gcc.c-torture / compile / 981006-1.c
blob6af6d9a8ea5afc93bd3aed600bda5822ecebb6c6
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 compile } */
8 int foo (int a, int b)
10 __label__ z;
11 int x; /* { dg-bogus "warning: `.' might be used uninitialized in this function" } */
12 int y; /* { dg-bogus "warning: `.' might be used uninitialized in this function" } */
13 static void *p;
15 switch (a) {
16 case 2:
17 x = 4;
18 break;
19 case 4:
20 x = 6;
21 break;
22 case 8: case 10: case 13: case 11: case 17: case 19:
23 x = 7;
24 break;
25 default:
26 x = -1;
27 break;
29 switch (b) {
30 case 2:
31 y = 4;
32 break;
33 case 4:
34 y = 6;
35 break;
36 case 8: case 10: case 13: case 11: case 17: case 19:
37 y = 7;
38 break;
39 default:
40 y = -1;
41 break;
44 p = &&z;
45 return x * y;
47 int main (int argc, char *argv[])
49 return 1 == foo (argc, argc + 1);