commit b8b54f0d5c97324a7534bfeed523660c7296f9da
parent fa0027223d9664bec5f475be753b5f6258584cb5
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Sat, 3 Oct 2015 12:08:44 +0200
Add test for concatenation in the preprocessor
Diffstat:
1 file changed, 33 insertions(+), 0 deletions(-)
diff --git a/cc1/tests/test031.c 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;
+}
+