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 || l)
14 v = r;
15
16 if (m) g++;
17 else bar();
18
19 if ( n && l)
20 blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
21
22 if ( n )
23 blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
24
25 if ( l )
26 blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
27
28 return 0;
29 }
30
foo_2(int n,int l,int m,int r)31 int foo_2 (int n, int l, int m, int r)
32 {
33 int v;
34
35 if (n || l)
36 v = r;
37
38 if (m) g++;
39 else bar();
40
41 if ( n && l)
42 blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
43
44 if ( n )
45 blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
46
47 if (m || l)
48 blah (v); /* { dg-warning "uninitialized" "warning" } */
49
50 if ( l )
51 blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
52
53 return 0;
54 }
55