2012-12-01 Alessandro Fanfarillo <alessandro.fanfarillo@gmail.com>
[official-gcc.git] / gcc / testsuite / gcc.dg / Wjump-misses-init-2.c
blob042c02aa7bdeb5c29a8e4b953631a25aa1b656ab
1 /* { dg-do compile } */
2 /* { dg-options "-Wjump-misses-init -std=c99" } */
3 extern void f1 ();
4 int
5 f2 (int a)
7 switch (a) /* { dg-message "switch" } */
9 case 1:
10 f1 ();
11 int v2 = 3; /* { dg-message "here" } */
12 case 2: /* { dg-warning "jump" } */
13 if (v2 == 7)
14 f1 ();
16 return 0;
19 int
20 f3 (int i)
22 if (i)
23 goto bad; /* { dg-warning "jump" } */
24 int a = f2 (i); /* { dg-message "here" } */
25 bad: /* { dg-message "here" } */
26 return a;
29 int
30 f4 (int a)
32 switch (a)
34 case 1:
35 f1 ();
36 static int v2 = 3;
37 case 2:
38 if (v2 == 7)
39 f1 ();
41 return 0;
44 int
45 f5 (int i)
47 if (i)
48 goto bad;
49 static int a = 6;
50 bad:
51 return a;