OSDN Git Service

new test - traditional token paste
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 6 May 2000 19:07:34 +0000 (19:07 +0000)
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 6 May 2000 19:07:34 +0000 (19:07 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33732 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/gcc.dg/cpp-tradpaste.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/cpp-tradpaste.c b/gcc/testsuite/gcc.dg/cpp-tradpaste.c
new file mode 100644 (file)
index 0000000..ac8a47b
--- /dev/null
@@ -0,0 +1,17 @@
+/* Test for proper comment elimination semantics from cpplib's -traditional.
+   This should compile and link with compiled with `gcc -traditional-cpp'.
+   Test case by Jason R. Thorpe <thorpej@zembu.com>.  */
+
+/* { dg-do compile } */
+/* { dg-options "-traditional" } */
+
+#define A(name) X/**/name
+
+#define B(name) \
+void A(Y/**/name)() { A(name)(); }
+
+void Xhello() { printf("hello world\n"); }
+
+B(hello)
+
+int main() { XYhello(); return (0); }