1 // RUN: %clang_cc1 -triple thumbv7-windows -fms-compatibility -fsyntax-only %s -verify
4 typedef char * va_list;
7 void test_no_arguments(int i
, ...) {
8 __va_start(); // expected-error{{too few arguments to function call, expected at least 3, have 0}}
11 void test_one_argument(int i
, ...) {
13 __va_start(&ap
); // expected-error{{too few arguments to function call, expected at least 3, have 1}}
16 void test_two_arguments(int i
, ...) {
18 __va_start(&ap
, &i
); // expected-error{{too few arguments to function call, expected at least 3, have 2}}
21 void test_non_last_argument(int i
, int j
, ...) {
23 __va_start(&ap
, &i
, 4);
24 // expected-error@-1{{passing 'int *' to parameter of incompatible type 'const char *': type mismatch at 2nd parameter ('int *' vs 'const char *')}}
25 // expected-error@-2{{passing 'int' to parameter of incompatible type 'unsigned int': type mismatch at 3rd parameter ('int' vs 'unsigned int')}}
28 void test_stack_allocated(int i
, ...) {
31 __va_start(&ap
, &j
, 4);
32 // expected-error@-1{{passing 'int *' to parameter of incompatible type 'const char *': type mismatch at 2nd parameter ('int *' vs 'const char *')}}
33 // expected-error@-2{{passing 'int' to parameter of incompatible type 'unsigned int': type mismatch at 3rd parameter ('int' vs 'unsigned int')}}
36 void test_non_pointer_addressof(int i
, ...) {
38 __va_start(&ap
, 1, 4);
39 // expected-error@-1{{passing 'int' to parameter of incompatible type 'const char *': type mismatch at 2nd parameter ('int' vs 'const char *')}}
40 // expected-error@-2{{passing 'int' to parameter of incompatible type 'unsigned int': type mismatch at 3rd parameter ('int' vs 'unsigned int')}}