aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-paste.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-paste.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-paste.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-paste.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-paste.c
new file mode 100644
index 000000000..1dd827663
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-paste.c
@@ -0,0 +1,19 @@
+/* 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-cpp" } */
+
+extern int printf (const char *, ...);
+
+#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); }