diff --git a/gcc/testsuite/gcc.dg/cpp-tradpaste.c b/gcc/testsuite/gcc.dg/cpp-tradpaste.c new file mode 100644 index 00000000000..ac8a47bcbf5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp-tradpaste.c @@ -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 . */ + +/* { 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); }