summaryrefslogtreecommitdiffstats
path: root/test/Sema/varargs.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/varargs.c')
-rw-r--r--test/Sema/varargs.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Sema/varargs.c b/test/Sema/varargs.c
index e399f89..07081ed 100644
--- a/test/Sema/varargs.c
+++ b/test/Sema/varargs.c
@@ -61,3 +61,18 @@ void f7(int a, ...) {
__builtin_va_end(ap);
}
+void f8(int a, ...) {
+ __builtin_va_list ap;
+ __builtin_va_start(ap, a);
+ (void)__builtin_va_arg(ap, void); // expected-error {{second argument to 'va_arg' is of incomplete type 'void'}}
+ __builtin_va_end(ap);
+}
+
+enum E { x = -1, y = 2, z = 10000 };
+void f9(__builtin_va_list args)
+{
+ (void)__builtin_va_arg(args, float); // expected-warning {{second argument to 'va_arg' is of promotable type 'float'}}
+ (void)__builtin_va_arg(args, enum E); // Don't warn here in C
+ (void)__builtin_va_arg(args, short); // expected-warning {{second argument to 'va_arg' is of promotable type 'short'}}
+ (void)__builtin_va_arg(args, char); // expected-warning {{second argument to 'va_arg' is of promotable type 'char'}}
+}
OpenPOWER on IntegriCloud