diff options
author | davidxl <davidxl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-04-28 17:41:31 +0000 |
---|---|---|
committer | davidxl <davidxl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-04-28 17:41:31 +0000 |
commit | a7d4604bc678dd3d354e0bc935550b0e0168ab59 (patch) | |
tree | 371e321349590c66d4a3929d9c841eb7fe2c2cfa /gcc/testsuite/gcc.dg/uninit-pred-9_b.c | |
parent | 913fc649340a7c990e0bccc8481a8f2f23d8573b (diff) | |
download | gcc-a7d4604bc678dd3d354e0bc935550b0e0168ab59.tar.gz |
predicate aware uninitialized analysis
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158835 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/uninit-pred-9_b.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/uninit-pred-9_b.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/uninit-pred-9_b.c b/gcc/testsuite/gcc.dg/uninit-pred-9_b.c new file mode 100644 index 00000000000..d9ae75e0765 --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-pred-9_b.c @@ -0,0 +1,44 @@ + +/* { dg-do compile } */ +/* { dg-options "-Wuninitialized -O2" } */ + +int g; +void bar(); +void blah(int); + +int foo (int n, int l, int m, int r) +{ + int v; + + if ( (n < 10) && (m != 100) && (r < 20) ) + v = r; + + if (m) g++; + else bar(); + + if (l > 100) + if ( (n <= 9) && (m < 100) && (r < 19) ) + blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */ + + if ( (n <= 8) && (m < 99) && (r < 19) ) + blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */ + + return 0; +} + +int foo_2 (int n, int l, int m, int r) +{ + int v; + + if ( (n < 10) && (m != 100) && (r < 20) ) + v = r; + + if (m) g++; + else bar(); + + if (l > 100) + if ( (n <= 8) && (m < 101) && (r < 19) ) + blah(v); /* { dg-warning "uninitialized" "real warning" } */ + + return 0; +} |