shithub: scc

Download patch

ref: b8b54f0d5c97324a7534bfeed523660c7296f9da
parent: fa0027223d9664bec5f475be753b5f6258584cb5
author: Roberto E. Vargas Caballero <[email protected]>
date: Sat Oct 3 08:08:44 EDT 2015

Add test for concatenation in the preprocessor

--- /dev/null
+++ b/cc1/tests/test031.c
@@ -1,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;
+}
+