Let tree_single_nonzero_warnv_p use range information
[official-gcc.git] / gcc / testsuite / gcc.dg / uninit-pred-4_a.c
blob7b2d291a66f15664f0dee76b07fd73e4683a4a29
1 /* { dg-do compile } */
2 /* { dg-options "-Wuninitialized -O2" } */
4 int g;
5 void bar();
6 void blah(int);
7 int foo (int n, int m, int r, int t)
9 int flag = 0;
10 int v;
12 if (t)
14 if (n)
16 v = r; /* init path 1 */
17 flag = 1;
20 if (m)
21 g++;
22 else
23 bar();
25 if (flag) /* properly guarded */
26 blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
28 else
30 v = r+1; /* init path 2 */
31 flag = 2;
34 if (m)
35 g++;
36 else
37 bar();
39 if (flag) /* properly guarded */
40 blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
42 return 0;