commit b8b54f0d5c97324a7534bfeed523660c7296f9da
Author:     Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Sat Oct 3 12:08:44 2015 +0200
Commit:     Roberto E. Vargas Caballero <[email protected]>
CommitDate: Sat Oct 3 12:12:46 2015 +0200

    Add test for concatenation in the preprocessor

diff --git a/cc1/tests/test031.c b/cc1/tests/test031.c
new file mode 100644
index 0000000..b358d8d
--- /dev/null
+++ b/cc1/tests/test031.c
@@ -0,0 +1,33 @@
+
+/*
+name: TEST031
+description: Test concatenation in preprocessor
+output:
+F5     I
+G6     F5      main
+{
+\
+A7     I       foo
+A8     I       bar
+A9     I       foobar
+       A9      A7      A8      +I      :I
+       A9      A7      A8      +I      :I
+       r       #I0
+}
+*/
+
+#define CAT(x,y) x ## y
+#define XCAT(x,y) CAT(x,y)
+#define FOO foo
+#define BAR bar
+
+int
+main(void)
+{
+       int foo, bar, foobar;
+
+       CAT(foo,bar) = foo + bar;
+       XCAT(FOO,BAR) = foo + bar;
+       return 0;
+}
+

Reply via email to