OSDN Git Service

Regression test for current cpplib bug.
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Apr 1999 21:31:13 +0000 (21:31 +0000)
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Apr 1999 21:31:13 +0000 (21:31 +0000)
Should not fail if you are using cccp.
Expect it to fail if you are using cpplib.

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

gcc/testsuite/gcc.dg/990407-1.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/990407-1.c b/gcc/testsuite/gcc.dg/990407-1.c
new file mode 100644 (file)
index 0000000..96b3f86
--- /dev/null
@@ -0,0 +1,18 @@
+/* Regression test for a cpplib macro-expansion bug where
+   `@' becomes `@@' when stringified.  */
+
+/* { dg-do run } */
+
+#include <string.h>
+
+#define STR(x) #x
+
+char *a = STR(@foo), *b = "@foo";
+
+int
+main(void)
+{
+  if (strcmp (a, b))
+    abort ();
+  return 0;
+}