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 
23