aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
-rw-r--r--validation/preprocessor1.c14
-rw-r--r--validation/preprocessor2.c15
2 files changed, 29 insertions, 0 deletions
diff --git a/validation/preprocessor1.c b/validation/preprocessor1.c
new file mode 100644
index 00000000..5ae20aab
--- /dev/null
+++ b/validation/preprocessor1.c
@@ -0,0 +1,14 @@
+/*
+ * This makes us really hurl chunks, causing
+ * infinite recursion until we run out of stack.
+ *
+ * It _should_ result in just a single plain
+ *
+ * "foo"
+ *
+ * (without the quotes).
+ */
+#define func(x) x
+#define bar func(
+#define foo bar foo
+foo )
diff --git a/validation/preprocessor2.c b/validation/preprocessor2.c
new file mode 100644
index 00000000..340938ee
--- /dev/null
+++ b/validation/preprocessor2.c
@@ -0,0 +1,15 @@
+/*
+ * This one we happen to get right.
+ *
+ * It should result in a simple
+ *
+ * a + b
+ *
+ * for a proper preprocessor.
+ */
+#define TWO a, b
+
+#define UNARY(x) BINARY(x)
+#define BINARY(x, y) x + y
+
+UNARY(TWO)