diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/Wfatal.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/Wfatal.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/Wfatal.c b/gcc/testsuite/gcc.dg/Wfatal.c new file mode 100644 index 000000000..7ac260bfa --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wfatal.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-Woverflow -Werror=div-by-zero -Wfatal-errors" } */ +#include <limits.h> + +int i = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */ +int k = 1 / 0; /* { dg-error "division by zero" } */ +int j = INT_MIN - 1; +/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */ +/* { dg-message "terminated due to -Wfatal-errors" "" { target *-*-* } 0 } */ + + + |