summaryrefslogtreecommitdiffstats
path: root/tests/preprocessor/recursive-macro.slang
diff options
context:
space:
mode:
Diffstat (limited to 'tests/preprocessor/recursive-macro.slang')
-rw-r--r--tests/preprocessor/recursive-macro.slang20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/preprocessor/recursive-macro.slang b/tests/preprocessor/recursive-macro.slang
index 1f776ca72..ac99687b2 100644
--- a/tests/preprocessor/recursive-macro.slang
+++ b/tests/preprocessor/recursive-macro.slang
@@ -22,4 +22,24 @@
int NO_EXPAND(b)
{
return b + ARG_EXPAND(ARG_EXPAND(1));
+}
+
+// The same issue can arise for object-like macros and not
+// just function-like, so we will test that case here as well.
+
+int objectLikeMacroTest( int REC )
+{
+#define REC REC
+
+ return REC;
+}
+
+// We also need to check the case where macros are
+// mutually, rather than directly, recursive
+
+int mutuallyRecursiveMacroTest( int XYZ )
+{
+ #define ABC XYZ
+ #define XYZ ABC
+ return XYZ;
} \ No newline at end of file