diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/Wstrict-overflow-24.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/Wstrict-overflow-24.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/Wstrict-overflow-24.c b/gcc/testsuite/gcc.dg/Wstrict-overflow-24.c new file mode 100644 index 00000000000..05e8dd14484 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wstrict-overflow-24.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-fstrict-overflow -O2" } */ +/* { dg-message "warnings being treated as errors" "" {target "*-*-*"} 0 } */ +#pragma GCC diagnostic error "-Wstrict-overflow" + +int +foo (int i) +{ + return __builtin_abs (i) >= 0; /* { dg-error "assuming signed overflow does not occur" "correct warning" } */ +} |