aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/preprocessor
diff options
authorAl Viro <viro@zeniv.linux.org.uk>2010-10-21 04:02:59 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-04-13 20:55:34 -0400
commit519a65d26c4c1a9a72046ab4dcb594a64d19a662 (patch)
treeed75790f9bc147b3129c3a3132c83140b04aa7b1 /validation/preprocessor
parentd6b8d38f0ef16a1c24b62411e1aecfff86073f17 (diff)
downloadsparse-dev-519a65d26c4c1a9a72046ab4dcb594a64d19a662.tar.gz
Fix ,##__VA_ARGS__ kludge
a) it actually allows any number of ##<arg>##... in between, as long as all those args are empty. b) it does *not* allow ## after __VA_ARGS__ - if it's there magic disappears Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'validation/preprocessor')
-rw-r--r--validation/preprocessor/preprocessor14.c1
-rw-r--r--validation/preprocessor/preprocessor23.c47
2 files changed, 47 insertions, 1 deletions
diff --git a/validation/preprocessor/preprocessor14.c b/validation/preprocessor/preprocessor14.c
index 05fc248b..027af040 100644
--- a/validation/preprocessor/preprocessor14.c
+++ b/validation/preprocessor/preprocessor14.c
@@ -7,7 +7,6 @@ A(,1)
B(,1)
/*
* check-name: Preprocessor #14
- * check-known-to-fail
* check-command: sparse -E $file
*
* check-output-start
diff --git a/validation/preprocessor/preprocessor23.c b/validation/preprocessor/preprocessor23.c
new file mode 100644
index 00000000..25be5085
--- /dev/null
+++ b/validation/preprocessor/preprocessor23.c
@@ -0,0 +1,47 @@
+#define H(x,...) ,##x##__VA_ARGS__##,##__VA_ARGS__
+H()
+H(x)
+H(,)
+H(x,)
+H(,x)
+H(x,x)
+#define I(x,...) ,##x##__VA_ARGS__
+I()
+I(x)
+I(,)
+I(x,)
+I(,x)
+I(x,x)
+/*
+ * check-name: Preprocessor #23
+ * check-command: sparse -E $file
+ *
+ * check-output-start
+
+,
+,x
+,,
+,x,
+,x,x
+,xx,x
+,x
+,
+,x
+,x
+,xx
+ * check-output-end
+ *
+ * check-error-start
+preprocessor/preprocessor23.c:3:1: error: '##' failed: concatenation is not a valid token
+preprocessor/preprocessor23.c:4:1: error: '##' failed: concatenation is not a valid token
+preprocessor/preprocessor23.c:5:1: error: '##' failed: concatenation is not a valid token
+preprocessor/preprocessor23.c:5:1: error: '##' failed: concatenation is not a valid token
+preprocessor/preprocessor23.c:6:1: error: '##' failed: concatenation is not a valid token
+preprocessor/preprocessor23.c:6:1: error: '##' failed: concatenation is not a valid token
+preprocessor/preprocessor23.c:7:1: error: '##' failed: concatenation is not a valid token
+preprocessor/preprocessor23.c:7:1: error: '##' failed: concatenation is not a valid token
+preprocessor/preprocessor23.c:10:1: error: '##' failed: concatenation is not a valid token
+preprocessor/preprocessor23.c:12:1: error: '##' failed: concatenation is not a valid token
+preprocessor/preprocessor23.c:14:1: error: '##' failed: concatenation is not a valid token
+ * check-error-end
+ */