diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/warn/Woverflow-1.C')
-rw-r--r-- | gcc/testsuite/g++.dg/warn/Woverflow-1.C | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/warn/Woverflow-1.C b/gcc/testsuite/g++.dg/warn/Woverflow-1.C new file mode 100644 index 00000000000..66750472e74 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Woverflow-1.C @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +#include <limits.h> + +int foo = INT_MAX + 1; /* { dg-warning "integer overflow" } */ + +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +#include <limits.h> + +int foo = INT_MAX + 1; /* { dg-warning "integer overflow" } */ + +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +#include <limits.h> + +int foo = INT_MAX + 1; /* { dg-warning "integer overflow" } */ + |