Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions -x objective-c++ %s |
Steve Naroff | 239f073 | 2008-12-25 14:16:32 +0000 | [diff] [blame] | 2 | __stdcall int func0(); |
| 3 | int __stdcall func(); |
| 4 | typedef int (__cdecl *tptr)(); |
| 5 | void (*__fastcall fastpfunc)(); |
| 6 | extern __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 Naroff | 86bc6cf | 2008-12-25 14:41:26 +0000 | [diff] [blame] | 9 | typedef __w64 unsigned long ULONG_PTR, *PULONG_PTR; |
| 10 | void * __ptr64 PtrToPtr64(const void *p) |
| 11 | { |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 12 | return((void * __ptr64) (unsigned __int64) (ULONG_PTR)p ); |
Steve Naroff | 86bc6cf | 2008-12-25 14:41:26 +0000 | [diff] [blame] | 13 | } |
Mike Stump | d1969d8 | 2009-07-22 00:43:08 +0000 | [diff] [blame] | 14 | void __forceinline InterlockedBitTestAndSet (long *Base, long Bit) |
Steve Naroff | 86bc6cf | 2008-12-25 14:41:26 +0000 | [diff] [blame] | 15 | { |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 16 | __asm { |
| 17 | mov eax, Bit |
| 18 | mov ecx, Base |
| 19 | lock bts [ecx], eax |
| 20 | setc al |
| 21 | }; |
Steve Naroff | 86bc6cf | 2008-12-25 14:41:26 +0000 | [diff] [blame] | 22 | } |
| 23 | |
Steve Naroff | 47f5209 | 2009-01-06 19:34:12 +0000 | [diff] [blame] | 24 | void *_alloca(int); |
| 25 | |
| 26 | void foo() { |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 27 | __declspec(align(16)) int *buffer = (int *)_alloca(9); |
Steve Naroff | 47f5209 | 2009-01-06 19:34:12 +0000 | [diff] [blame] | 28 | } |
Douglas Gregor | 5a2f5d3 | 2009-01-10 00:48:18 +0000 | [diff] [blame] | 29 | |
| 30 | typedef bool (__stdcall __stdcall *blarg)(int); |
Chris Lattner | 6633522 | 2009-12-23 19:15:27 +0000 | [diff] [blame^] | 31 | |
| 32 | |
| 33 | // Charify extension. |
| 34 | #define FOO(x) #@x |
| 35 | char x = FOO(a); |
| 36 | |