1 // RUN: %clang_cc1 -triple thumbv7-windows -fms-compatibility -fsyntax-only %s -verify
2 // RUN: %clang_cc1 -triple aarch64-windows -fms-compatibility -fsyntax-only %s -verify
3 // expected-no-diagnostics
6 typedef char * va_list;
7 void __va_start(va_list *, ...);
10 int test___va_start(int i
, ...) {
12 __va_start(&ap
, ( &reinterpret_cast<const char &>(i
) ),
13 ( (sizeof(i
) + 4 - 1) & ~(4 - 1) ),
14 ( &reinterpret_cast<const char &>(i
) ));
15 return (*(int *)((ap
+= ( (sizeof(int) + 4 - 1) & ~(4 - 1) ) + ( ((va_list)0 - (ap
)) & (__alignof(int) - 1) )) - ( (sizeof(int) + 4 - 1) & ~(4 - 1) )));
18 int builtin(int i
, ...) {
20 __builtin_va_start(ap
, i
);
21 return __builtin_va_arg(ap
, int);
24 void test___va_start_ignore_const(const char *format
, ...) {
26 ((void)(__va_start(&args
, (&const_cast<char &>(reinterpret_cast<const volatile char &>(format
))), ((sizeof(format
) + 4 - 1) & ~(4 - 1)), (&const_cast<char &>(reinterpret_cast<const volatile char &>(format
))))));