OSDN Git Service

For Greta Yorsh.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / uninit-suppress_2.c
1 /* { dg-do compile } */
2 /* { dg-options "-fno-tree-ccp -fno-tree-vrp -O2 -Wuninitialized -Werror=uninitialized -Wno-error=maybe-uninitialized" } */
3 void blah();
4 int gflag;
5
6 void foo()
7 {
8    int v;
9    if (gflag)
10      v = 10;
11
12    blah(); /* *gflag may be killed, but compiler won't know */
13
14    if (gflag)
15     bar(v);   /* { dg-warning "uninitialized" "should not be promoted to error" } */
16 }