diff options
author | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-20 10:18:58 +0000 |
---|---|---|
committer | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-20 10:18:58 +0000 |
commit | f9a354ab874523e074a821eb7ba9e7ddead4aaf0 (patch) | |
tree | fa32faad84393dfa336f79b8f5cfeab5bd3aad7b /gcc/testsuite/gcc.dg/Wfatal-2.c | |
parent | ef1ec07380c84289965dee395c74c184309f5a01 (diff) | |
download | gcc-f9a354ab874523e074a821eb7ba9e7ddead4aaf0.tar.gz |
2007-02-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
DJ Delorie <dj@redhat.com>
PR other/30824
* diagnostic.c (diagnostic_count_diagnostic): Move -Werror
logic to...
(diagnostic_report_diagnostic): ... here, and turn them into
real errors. If warnings are inhibited, no need to do
anything.
testsuite/
* gcc.dg/Wfatal.c: New.
* gcc.dg/Wfatal-2.c: New.
* gcc.dg/Werror-1.c: Adjust expectations.
* gcc.dg/Werror-5.c: Likewise.
* gcc.dg/Werror-7.c: Likewise.
* gcc.dg/Werror-10.c: Likewise.
* gcc.dg/Werror-11.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122159 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/Wfatal-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/Wfatal-2.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/Wfatal-2.c b/gcc/testsuite/gcc.dg/Wfatal-2.c new file mode 100644 index 00000000000..cbb7c8e8ff8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wfatal-2.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-Woverflow -Wdiv-by-zero -Werror -Wfatal-errors" } */ +#include <limits.h> + +int i = INT_MAX + 1; /* { dg-error "integer overflow in expression" } */ +int k = 1 / 0; +int j = INT_MIN - 1; +/* { dg-warning "being treated as errors" "" { target *-*-* } 0 } */ +/* { dg-warning "terminated due to -Wfatal-errors" "" { target *-*-* } 0 } */ |