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