aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/preprocessor1.c
diff options
authorLinus Torvalds <torvalds@home.osdl.org>2003-07-17 23:28:03 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:00:56 -0700
commit10e9653b49d81800837f1e7c8ea39039cb32a27f (patch)
treebcdb20c427ad8e97810d2623cea5f86b60c3820b /validation/preprocessor1.c
parent8d121d51b6f88e90d166af84d098c6e3af066a87 (diff)
downloadsparse-dev-10e9653b49d81800837f1e7c8ea39039cb32a27f.tar.gz
Add two preprocessor test-cases from comp.std.c.
We actually pass one of them, surprise surprise. I should add a few more that highlight the known problems in token pasting etc, but I'm lazy. The C preprocessor is a bitch.
Diffstat (limited to 'validation/preprocessor1.c')
-rw-r--r--validation/preprocessor1.c14
1 files changed, 14 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 )