xref: /minix3/external/bsd/llvm/dist/clang/test/Parser/MicrosoftExtensionsInlineAsm.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // REQUIRES: x86-registered-target
2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple i386-mingw32 -fsyntax-only -verify -fms-extensions  %s
3*0a6a1f1dSLionel Sambuc // expected-no-diagnostics
4*0a6a1f1dSLionel Sambuc 
InterlockedBitTestAndSet(long * Base,long Bit)5*0a6a1f1dSLionel Sambuc void __forceinline InterlockedBitTestAndSet (long *Base, long Bit)
6*0a6a1f1dSLionel Sambuc {
7*0a6a1f1dSLionel Sambuc   __asm {
8*0a6a1f1dSLionel Sambuc     mov eax, Bit
9*0a6a1f1dSLionel Sambuc     mov ecx, Base
10*0a6a1f1dSLionel Sambuc     lock bts [ecx], eax
11*0a6a1f1dSLionel Sambuc     setc al
12*0a6a1f1dSLionel Sambuc   };
13*0a6a1f1dSLionel Sambuc }
14