1// RUN: %clang_cc1 -triple thumbv7-windows -fms-compatibility -fsyntax-only %s -verify 2 3extern "C" { 4typedef char * va_list; 5} 6 7void test_no_arguments(int i, ...) { 8 __va_start(); // expected-error{{too few arguments to function call, expected at least 3, have 0}} 9} 10 11void test_one_argument(int i, ...) { 12 va_list ap; 13 __va_start(&ap); // expected-error{{too few arguments to function call, expected at least 3, have 1}} 14} 15 16void test_two_arguments(int i, ...) { 17 va_list ap; 18 __va_start(&ap, &i); // expected-error{{too few arguments to function call, expected at least 3, have 2}} 19} 20 21void test_non_last_argument(int i, int j, ...) { 22 va_list ap; 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')}} 26} 27 28void test_stack_allocated(int i, ...) { 29 va_list ap; 30 int j; 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')}} 34} 35 36void test_non_pointer_addressof(int i, ...) { 37 va_list ap; 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')}} 41} 42 43