[hackers] [scc] Add test for concatenation in the preprocessor || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Sat, 3 Oct 2015 12:13:12 +0200 (CEST)

commit b8b54f0d5c97324a7534bfeed523660c7296f9da
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Sat Oct 3 12:08:44 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
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
_AT_@ -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;
+}
+
Received on Sat Oct 03 2015 - 12:13:12 CEST

This archive was generated by hypermail 2.3.0 : Sat Oct 03 2015 - 12:24:16 CEST