aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2007-02-20 10:18:58 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2007-02-20 10:18:58 +0000
commit4e2bae26bfa2eab9678a125a7701291fe3dd7153 (patch)
treefa32faad84393dfa336f79b8f5cfeab5bd3aad7b /gcc/testsuite
parent6bdcc60c754f23ad4cdaa61df43ef5acb1c5465b (diff)
downloadgcc-4e2bae26bfa2eab9678a125a7701291fe3dd7153.zip
gcc-4e2bae26bfa2eab9678a125a7701291fe3dd7153.tar.gz
gcc-4e2bae26bfa2eab9678a125a7701291fe3dd7153.tar.bz2
re PR other/30824 (-Werror -Wfatal-errors should stop after the first warning)
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. Co-Authored-By: DJ Delorie <dj@redhat.com> From-SVN: r122159
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog12
-rw-r--r--gcc/testsuite/gcc.dg/Werror-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/Werror-10.c2
-rw-r--r--gcc/testsuite/gcc.dg/Werror-11.c2
-rw-r--r--gcc/testsuite/gcc.dg/Werror-5.c4
-rw-r--r--gcc/testsuite/gcc.dg/Werror-7.c2
-rw-r--r--gcc/testsuite/gcc.dg/Wfatal-2.c9
-rw-r--r--gcc/testsuite/gcc.dg/Wfatal.c11
8 files changed, 38 insertions, 6 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8e85108..b5f91c5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,15 @@
+2007-02-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+ DJ Delorie <dj@redhat.com>
+
+ PR other/30824
+ * 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.
+
2007-02-20 Tobias Burnus <burnus@net-b.de>
PR fortran/30522
diff --git a/gcc/testsuite/gcc.dg/Werror-1.c b/gcc/testsuite/gcc.dg/Werror-1.c
index 7984740..33fc1d3 100644
--- a/gcc/testsuite/gcc.dg/Werror-1.c
+++ b/gcc/testsuite/gcc.dg/Werror-1.c
@@ -9,7 +9,7 @@
#pragma GCC diagnostic error "-Waddress"
-void __attribute__((dj)) bar() { } /* { dg-warning "warning: .* attribute directive ignored" } */
+void __attribute__((dj)) bar() { } /* { dg-error "error: .* attribute directive ignored" } */
int i;
diff --git a/gcc/testsuite/gcc.dg/Werror-10.c b/gcc/testsuite/gcc.dg/Werror-10.c
index eeadf51..f564654 100644
--- a/gcc/testsuite/gcc.dg/Werror-10.c
+++ b/gcc/testsuite/gcc.dg/Werror-10.c
@@ -6,7 +6,7 @@
#pragma GCC diagnostic error "-Waddress"
-void __attribute__((dj)) bar() { } /* { dg-warning "warning: .* attribute directive ignored" } */
+void __attribute__((dj)) bar() { } /* { dg-error "error: .* attribute directive ignored" } */
int i;
diff --git a/gcc/testsuite/gcc.dg/Werror-11.c b/gcc/testsuite/gcc.dg/Werror-11.c
index 493ded0..0dea5fa 100644
--- a/gcc/testsuite/gcc.dg/Werror-11.c
+++ b/gcc/testsuite/gcc.dg/Werror-11.c
@@ -6,7 +6,7 @@
#pragma GCC diagnostic warning "-Waddress"
-void __attribute__((dj)) bar() { } /* { dg-warning "warning: .* attribute directive ignored" } */
+void __attribute__((dj)) bar() { } /* { dg-error "error: .* attribute directive ignored" } */
int i;
diff --git a/gcc/testsuite/gcc.dg/Werror-5.c b/gcc/testsuite/gcc.dg/Werror-5.c
index 40d3cd1..8a21593 100644
--- a/gcc/testsuite/gcc.dg/Werror-5.c
+++ b/gcc/testsuite/gcc.dg/Werror-5.c
@@ -4,13 +4,13 @@
/* Make sure -Werror turns warnings in to errors. */
-void __attribute__((dj)) bar() { } /* { dg-warning "warning: .* attribute directive ignored" } */
+void __attribute__((dj)) bar() { } /* { dg-error "error: .* attribute directive ignored" } */
int i;
void
foo ()
{
- if (&i) /* { dg-warning "warning: .* will always evaluate as 'true'" } */
+ if (&i) /* { dg-error "error: .* will always evaluate as 'true'" } */
grill ();
}
diff --git a/gcc/testsuite/gcc.dg/Werror-7.c b/gcc/testsuite/gcc.dg/Werror-7.c
index 9829ce9..6a69fae 100644
--- a/gcc/testsuite/gcc.dg/Werror-7.c
+++ b/gcc/testsuite/gcc.dg/Werror-7.c
@@ -4,7 +4,7 @@
/* Make sure -Wno-error= overrides -Werror. */
-void __attribute__((dj)) bar() { } /* { dg-warning "warning: .* attribute directive ignored" } */
+void __attribute__((dj)) bar() { } /* { dg-error "error: .* attribute directive ignored" } */
int i;
diff --git a/gcc/testsuite/gcc.dg/Wfatal-2.c b/gcc/testsuite/gcc.dg/Wfatal-2.c
new file mode 100644
index 0000000..cbb7c8e
--- /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 } */
diff --git a/gcc/testsuite/gcc.dg/Wfatal.c b/gcc/testsuite/gcc.dg/Wfatal.c
new file mode 100644
index 0000000..bb3efc8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wfatal.c
@@ -0,0 +1,11 @@
+/* { 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-warning "terminated due to -Wfatal-errors" "" { target *-*-* } 0 } */
+
+
+