aboutsummaryrefslogtreecommitdiff
path: root/test/Preprocessor/macro_fn.c
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-20 21:08:10 +0000
committerChris Lattner <sabre@nondot.org>2009-04-20 21:08:10 +0000
commit97e2de171de555feb1ef422e71874082a67498c9 (patch)
tree497ca594ae45cac19e34c528a83315330af4cd8b /test/Preprocessor/macro_fn.c
parent3251ceb90b3fec68e86d6dcfa58836e20a7205c3 (diff)
fix the second half of PR4006 and rdar://6807000 by treating
() as being either zero arguments or one empty argument depending on situation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69627 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Preprocessor/macro_fn.c')
-rw-r--r--test/Preprocessor/macro_fn.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/Preprocessor/macro_fn.c b/test/Preprocessor/macro_fn.c
index 90dc2f06d6..98ebaeea72 100644
--- a/test/Preprocessor/macro_fn.c
+++ b/test/Preprocessor/macro_fn.c
@@ -4,6 +4,8 @@
#define zero() 0
#define one(x) 0
#define two(x, y) 0
+#define zero_dot(...) 0 /* expected-warning {{variadic macros were introduced in C99}} */
+#define one_dot(x, ...) 0 /* expected-warning {{variadic macros were introduced in C99}} */
zero()
zero(1); /* expected-error {{too many arguments provided to function-like macro invocation}} */
@@ -28,6 +30,11 @@ two(,) /* expected-warning 2 {{empty macro arguments were standardized in C
-/* PR4006 */
+/* PR4006 & rdar://6807000 */
#define e(...) __VA_ARGS__ /* expected-warning {{variadic macros were introduced in C99}} */
e(x)
+e()
+
+zero_dot()
+one_dot(x) /* empty ... argument: expected-warning {{varargs argument missing, but tolerated as an extension}} */
+one_dot() /* empty first argument, elided ...: expected-warning {{varargs argument missing, but tolerated as an extension}} */