blob: 0b2733e6946194b8b3c33621af796ca026b7381d [file] [log] [blame]
Charles Davisf0122fe2010-02-16 18:27:26 +00001// RUN: %clang_cc1 -triple i386-mingw32 -fsyntax-only -verify -fms-extensions -x objective-c++ %s
Steve Naroff239f0732008-12-25 14:16:32 +00002__stdcall int func0();
3int __stdcall func();
4typedef int (__cdecl *tptr)();
5void (*__fastcall fastpfunc)();
6extern __declspec(dllimport) void __stdcall VarR4FromDec();
7__declspec(deprecated) __declspec(deprecated) char * __cdecl ltoa( long _Val, char * _DstBuf, int _Radix);
8__declspec(noalias) __declspec(restrict) void * __cdecl xxx( void * _Memory );
Steve Naroff86bc6cf2008-12-25 14:41:26 +00009typedef __w64 unsigned long ULONG_PTR, *PULONG_PTR;
10void * __ptr64 PtrToPtr64(const void *p)
11{
Mike Stump1eb44332009-09-09 15:08:12 +000012 return((void * __ptr64) (unsigned __int64) (ULONG_PTR)p );
Steve Naroff86bc6cf2008-12-25 14:41:26 +000013}
Mike Stumpd1969d82009-07-22 00:43:08 +000014void __forceinline InterlockedBitTestAndSet (long *Base, long Bit)
Steve Naroff86bc6cf2008-12-25 14:41:26 +000015{
Mike Stump1eb44332009-09-09 15:08:12 +000016 __asm {
17 mov eax, Bit
18 mov ecx, Base
19 lock bts [ecx], eax
20 setc al
21 };
Steve Naroff86bc6cf2008-12-25 14:41:26 +000022}
23
Steve Naroff47f52092009-01-06 19:34:12 +000024void *_alloca(int);
25
26void foo() {
Mike Stump1eb44332009-09-09 15:08:12 +000027 __declspec(align(16)) int *buffer = (int *)_alloca(9);
Steve Naroff47f52092009-01-06 19:34:12 +000028}
Douglas Gregor5a2f5d32009-01-10 00:48:18 +000029
30typedef bool (__stdcall __stdcall *blarg)(int);
Chris Lattner66335222009-12-23 19:15:27 +000031
32
33// Charify extension.
34#define FOO(x) #@x
35char x = FOO(a);
36