extratokens2.c: New file.
authorPhil Edwards <pme@gcc.gnu.org>
Fri, 22 Mar 2002 21:44:30 +0000 (21:44 +0000)
committerPhil Edwards <pme@gcc.gnu.org>
Fri, 22 Mar 2002 21:44:30 +0000 (21:44 +0000)
2002-03-22  Phil Edwards  <pme@gcc.gnu.org>

* gcc.dg/cpp/extratokens2.c:  New file.

From-SVN: r51188

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/extratokens2.c [new file with mode: 0644]

index 1be42be4dda424af3d1baccc46e3c8daf90fb79a..06b2c0128fa8d5779b11c396460d64044d476208 100644 (file)
@@ -1,3 +1,7 @@
+2002-03-22  Phil Edwards  <pme@gcc.gnu.org>
+
+       * gcc.dg/cpp/extratokens2.c:  New file.
+
 2002-03-21  David Edelsohn  <edelsohn@gnu.org>
 
         * gcc.dg/20020312-2.c: Add rs6000 target.
diff --git a/gcc/testsuite/gcc.dg/cpp/extratokens2.c b/gcc/testsuite/gcc.dg/cpp/extratokens2.c
new file mode 100644 (file)
index 0000000..fe682bf
--- /dev/null
@@ -0,0 +1,22 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.  */
+
+/* { dg-do preprocess } */
+/* { dg-options "-fno-show-column -Wno-endif-labels" } */
+
+/* Tests that -Wno-endif-labels correctly disables the checks done by
+   default (and tested in extratokens.c).  */
+
+/* Source: Phil Edwards, 21 Mar 2002.  Copied from extratokens.c and
+   modified.  */
+
+#if 1 
+#if 0
+#else foo      /* { dg-bogus "extra tokens" "bad warning" } */
+#endif /       /* { dg-bogus "extra tokens" "bad warning" } */
+#endif
+
+# 36 "file.c" 3
+
+/* ... but in a system header, it's acceptable.  */
+#ifdef KERNEL
+#endif KERNEL  /* { dg-bogus "extra tokens" "bad warning" } */