1 // RUN: %clang_cc1 -triple thumbv7-windows -fms-compatibility -fsyntax-only %s -verify
2 // expected-no-diagnostics
3
4 extern "C" {
5 typedef char * va_list;
6 void __va_start(va_list *, ...);
7 }
8
test___va_start(int i,...)9 int test___va_start(int i, ...) {
10 va_list ap;
11 __va_start(&ap, ( &reinterpret_cast<const char &>(i) ),
12 ( (sizeof(i) + 4 - 1) & ~(4 - 1) ),
13 ( &reinterpret_cast<const char &>(i) ));
14 return (*(int *)((ap += ( (sizeof(int) + 4 - 1) & ~(4 - 1) ) + ( ((va_list)0 - (ap)) & (__alignof(int) - 1) )) - ( (sizeof(int) + 4 - 1) & ~(4 - 1) )));
15 }
16
builtin(int i,...)17 int builtin(int i, ...) {
18 __builtin_va_list ap;
19 __builtin_va_start(ap, i);
20 return __builtin_va_arg(ap, int);
21 }
22
test___va_start_ignore_const(const char * format,...)23 void test___va_start_ignore_const(const char *format, ...) {
24 va_list args;
25 ((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))))));
26 }
27
28