aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-07-17 20:05:01 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-07-17 20:05:01 +0000
commit537815242eb9dd7e704aac5f2bdea0c80c0655a2 (patch)
tree21ddc11c51d1e9d4000501b0351c8344ff0e7d67 /gcc
parentd882fe5150fbbeb4e44d007bb4964e5b22373021 (diff)
downloadgcc-537815242eb9dd7e704aac5f2bdea0c80c0655a2.zip
gcc-537815242eb9dd7e704aac5f2bdea0c80c0655a2.tar.gz
gcc-537815242eb9dd7e704aac5f2bdea0c80c0655a2.tar.bz2
syshdr.c: New test.
* gcc.dg/cpp/syshdr.c: New test. * gcc.dg/cpp/syshdr1.h, gcc.dg/cpp/syshdr2.h: New files. From-SVN: r35099
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/cpp/syshdr.c12
-rw-r--r--gcc/testsuite/gcc.dg/cpp/syshdr1.h4
-rw-r--r--gcc/testsuite/gcc.dg/cpp/syshdr2.h5
4 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 84aecc5..6e76c4d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2000-07-17 Zack Weinberg <zack@wolery.cumb.org>
+
+ * gcc.dg/cpp/syshdr.c: New test.
+ * gcc.dg/cpp/syshdr1.h, gcc.dg/cpp/syshdr2.h: New files.
+
2000-07-17 Neil Booth <neilb@earthling.net>
* gcc.dg/cpp/cmdlne-dM.c: New test.
diff --git a/gcc/testsuite/gcc.dg/cpp/syshdr.c b/gcc/testsuite/gcc.dg/cpp/syshdr.c
new file mode 100644
index 0000000..f36df3e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/syshdr.c
@@ -0,0 +1,12 @@
+/* Test for proper suppression of warnings in system headers,
+ and only in system headers. */
+/* FRAGILITY WARNING: The only way we have to distinguish the good error
+ from the bad error is that the good error is on line 4 and the bad is
+ on line 5 (of their respective files). dg.exp doesn't have any way to
+ condition error matchers on the file they're in. */
+
+/* { dg-do preprocess } */
+/* { dg-error "include_next" "good error" { target *-*-* } 4 } */
+
+#include "syshdr1.h" /* { dg-error "" "In file included from:" } */
+#include "syshdr2.h"
diff --git a/gcc/testsuite/gcc.dg/cpp/syshdr1.h b/gcc/testsuite/gcc.dg/cpp/syshdr1.h
new file mode 100644
index 0000000..310f39b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/syshdr1.h
@@ -0,0 +1,4 @@
+/* This file should generate an error because #include_next is not a
+ standard directive. */
+
+#include_next <stdio.h>
diff --git a/gcc/testsuite/gcc.dg/cpp/syshdr2.h b/gcc/testsuite/gcc.dg/cpp/syshdr2.h
new file mode 100644
index 0000000..0140fda
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/syshdr2.h
@@ -0,0 +1,5 @@
+/* This file would generate an error because of #include_next, but the
+ #pragma marks it a system header, so the error is suppressed. */
+
+#pragma GCC system_header
+#include_next <stdio.h>