1
2 /* { dg-do compile } */
3 /* { dg-options "-Wuninitialized -O2" } */
4
5 int g;
6 void bar();
7 void blah(int);
8
foo(int n,int l,int m,int r)9 int foo (int n, int l, int m, int r)
10 {
11 int v;
12
13 if (n > 10)
14 if (l)
15 v = r;
16
17 if (m) g++;
18 else bar();
19
20 if ( (n > 10) && l)
21 blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
22
23 if (l)
24 if (n > 12)
25 blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
26
27 return 0;
28 }
29
foo_2(int n,int l,int m,int r)30 int foo_2 (int n, int l, int m, int r)
31 {
32 int v;
33
34 if (n > 10)
35 if (l)
36 v = r;
37
38 if (m) g++;
39 else bar();
40
41 if (n > 8 )
42 if (l)
43 blah (v); /* { dg-warning "uninitialized" "warning" } */
44
45 return 0;
46 }
47