comparison gcc/testsuite/gcc.dg/uninit-pred-3_e.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* { dg-do compile } */
2 /* { dg-options "-Wuninitialized -O2" } */
3
4 int g;
5 void bar();
6 void blah(int);
7
8 int foo (int n, int m, int r)
9 {
10 int flag = 0;
11 int v;
12
13 if (n)
14 {
15 v = r;
16 flag = -1;
17 }
18
19 if (m)
20 g++;
21 else
22 bar();
23
24 if (r > 0)
25 if (flag <= 0 )
26 blah(v); /* { dg-warning "uninitialized" "real warning" } */
27 return 0;
28 }