1 /* RUN: %clang_cc1 %s -Eonly -std=c89 -pedantic -verify
7 #define zero_dot(...) 0 /* expected-warning {{variadic macros were introduced in C99}} */
8 #define one_dot(x, ...) 0 /* expected-warning {{variadic macros were introduced in C99}} */
11 zero(1); /* expected-error {{too many arguments provided to function-like macro invocation}} */
12 zero(1, 2, 3); /* expected-error {{too many arguments provided to function-like macro invocation}} */
16 one(a,) /* expected-error {{too many arguments provided to function-like macro invocation}} */
17 one(a, b) /* expected-error {{too many arguments provided to function-like macro invocation}} */
19 two() /* expected-error {{too few arguments provided to function-like macro invocation}} */
20 two(a) /* expected-error {{too few arguments provided to function-like macro invocation}} */
22 two(a, ) /* expected-warning {{empty macro arguments were standardized in C99}} */
23 two(a,b,c) /* expected-error {{too many arguments provided to function-like macro invocation}} */
25 , /* expected-warning {{empty macro arguments were standardized in C99}} */
26 , /* expected-warning {{empty macro arguments were standardized in C99}} \
27 expected-error {{too many arguments provided to function-like macro invocation}} */
29 two(,) /* expected-warning 2 {{empty macro arguments were standardized in C99}} */
33 /* PR4006 & rdar://6807000 */
34 #define e(...) __VA_ARGS__ /* expected-warning {{variadic macros were introduced in C99}} */
39 one_dot(x) /* empty ... argument: expected-warning {{varargs argument missing, but tolerated as an extension}} */
40 one_dot() /* empty first argument, elided ...: expected-warning {{varargs argument missing, but tolerated as an extension}} */
43 /* rdar://6816766 - Crash with function-like macro test at end of directive. */