This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
new cpp test cases
- To: gcc-patches at gcc dot gnu dot org
- Subject: new cpp test cases
- From: Zack Weinberg <zack at wolery dot cumb dot org>
- Date: Tue, 28 Mar 2000 11:20:10 -0800
I've added these test cases to the test suite. Patches will follow
shortly for cpp-hash[12].c; cpp-ifparen.c may take longer.
zw
===================================================================
Index: cpp-hash1.c
--- /dev/null Tue May 5 13:32:27 1998
+++ cpp-hash1.c Tue Mar 28 11:19:09 2000
@@ -0,0 +1,9 @@
+/* Test for proper handling of # in object-like macros.
+ From Linux kernel. */
+/* { dg-do preprocess } */
+
+#define FIXUP .section ".fixup",#alloc,#execinstr
+
+FIXUP
+
+/* { dg-bogus "not followed by" "object-like #" { target *-*-* } 3 } */
===================================================================
Index: cpp-hash2.c
--- /dev/null Tue May 5 13:32:27 1998
+++ cpp-hash2.c Tue Mar 28 11:19:09 2000
@@ -0,0 +1,15 @@
+/* Test for erroneously thinking comments are token-pastes.
+ From XFree86 4.0. */
+/* { dg-do preprocess } */
+/* { dg-options "-traditional" } */
+
+#ifndef foo
+#define foo /**/
+#endif
+
+#ifndef foo
+#define foo /* as nothing */
+#endif
+
+/* { dg-bogus "(start|end) of macro" "/**/ at end" { target *-*-* } 7 } */
+/* { dg-bogus "(start|end) of macro" "comment at end" { target *-*-* } 11 } */
===================================================================
Index: cpp-ifparen.c
--- /dev/null Tue May 5 13:32:27 1998
+++ cpp-ifparen.c Tue Mar 28 11:19:09 2000
@@ -0,0 +1,7 @@
+#if 2048 < (16 * (40) + 192)
+#error /* { dg-bogus "error" "with paren" } */
+#endif
+
+#if 2048 < (16 * 40 + 192)
+#error /* { dg-bogus "error" "without paren" } */
+#endif