aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/tests2/64_macro_nesting.c10
-rw-r--r--tests/tests2/64_macro_nesting.expect1
-rw-r--r--tests/tests2/Makefile3
3 files changed, 13 insertions, 1 deletions
diff --git a/tests/tests2/64_macro_nesting.c b/tests/tests2/64_macro_nesting.c
new file mode 100644
index 0000000..44b582f
--- /dev/null
+++ b/tests/tests2/64_macro_nesting.c
@@ -0,0 +1,10 @@
+#define CAT2(a,b) a##b
+#define CAT(a,b) CAT2(a,b)
+#define AB(x) CAT(x,y)
+
+int main(void)
+{
+ int xy = 42;
+ printf("%d\n", CAT(A,B)(x));
+ return 0;
+}
diff --git a/tests/tests2/64_macro_nesting.expect b/tests/tests2/64_macro_nesting.expect
new file mode 100644
index 0000000..d81cc07
--- /dev/null
+++ b/tests/tests2/64_macro_nesting.expect
@@ -0,0 +1 @@
+42
diff --git a/tests/tests2/Makefile b/tests/tests2/Makefile
index 4d5546d..36d84dc 100644
--- a/tests/tests2/Makefile
+++ b/tests/tests2/Makefile
@@ -78,7 +78,8 @@ TESTS = \
60_enum_redefinition.test \
61_undefined_enum.test \
62_enumerator_redefinition.test \
- 63_local_enumerator_redefinition.test
+ 63_local_enumerator_redefinition.test \
+ 64_macro_nesting.test
# 30_hanoi.test -- seg fault in the code, gcc as well
# 34_array_assignment.test -- array assignment is not in C standard