phunix/external/bsd/llvm/dist/clang/test/SemaCXX/microsoft-varargs.cpp
Lionel Sambuc 0a6a1f1d05 NetBSD re-synchronization of the source tree
This brings our tree to NetBSD 7.0, as found on -current on the
10-10-2015.

This updates:
 - LLVM to 3.6.1
 - GCC to GCC 5.1
 - Replace minix/commands/zdump with usr.bin/zdump
 - external/bsd/libelf has moved to /external/bsd/elftoolchain/
 - Import ctwm
 - Drop sprintf from libminc

Change-Id: I149836ac18e9326be9353958bab9b266efb056f0
2016-01-13 20:32:14 +01:00

23 lines
673 B
C++

// RUN: %clang_cc1 -triple thumbv7-windows -fms-compatibility -fsyntax-only %s -verify
// expected-no-diagnostics
extern "C" {
typedef char * va_list;
void __va_start(va_list *, ...);
}
int test___va_start(int i, ...) {
va_list ap;
__va_start(&ap, ( &reinterpret_cast<const char &>(i) ),
( (sizeof(i) + 4 - 1) & ~(4 - 1) ),
( &reinterpret_cast<const char &>(i) ));
return (*(int *)((ap += ( (sizeof(int) + 4 - 1) & ~(4 - 1) ) + ( ((va_list)0 - (ap)) & (__alignof(int) - 1) )) - ( (sizeof(int) + 4 - 1) & ~(4 - 1) )));
}
int builtin(int i, ...) {
__builtin_va_list ap;
__builtin_va_start(ap, i);
return __builtin_va_arg(ap, int);
}