OSDN Git Service

* gcc.dg/cpp/syshdr.c: New test.
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 Jul 2000 20:05:01 +0000 (20:05 +0000)
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 Jul 2000 20:05:01 +0000 (20:05 +0000)
* gcc.dg/cpp/syshdr1.h, gcc.dg/cpp/syshdr2.h: New files.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35099 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/syshdr.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/cpp/syshdr1.h [new file with mode: 0644]
gcc/testsuite/gcc.dg/cpp/syshdr2.h [new file with mode: 0644]

index 84aecc5..6e76c4d 100644 (file)
@@ -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 (file)
index 0000000..f36df3e
--- /dev/null
@@ -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 (file)
index 0000000..310f39b
--- /dev/null
@@ -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 (file)
index 0000000..0140fda
--- /dev/null
@@ -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>