diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/Wstrict-overflow-21.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/Wstrict-overflow-21.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/Wstrict-overflow-21.c b/gcc/testsuite/gcc.dg/Wstrict-overflow-21.c new file mode 100644 index 000000000..57e946526 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wstrict-overflow-21.c @@ -0,0 +1,12 @@ +/* PR 32102: -Wall stomps on -Wstrict-overflow */ +/* { dg-do compile } */ +/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=2 -Wall" } */ +int +foo () +{ + int i, bits; + for (i = 1, bits = 1; i > 0; i += i) /* { dg-warning "assuming signed overflow does not occur" "correct warning" } */ + ++bits; + return bits; +} + |