[lld][WebAssembly] Reinstate mistakenly disabled test. NFC
[llvm-project.git] / clang / test / SemaCXX / microsoft-varargs.cpp
blob311ce4a54f1fa2b9e692599f775a35054ced613b
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
5 extern "C" {
6 typedef char * va_list;
7 void __va_start(va_list *, ...);
10 int test___va_start(int i, ...) {
11 va_list ap;
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, ...) {
19 __builtin_va_list ap;
20 __builtin_va_start(ap, i);
21 return __builtin_va_arg(ap, int);
24 void test___va_start_ignore_const(const char *format, ...) {
25 va_list args;
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))))));