Move InterlockedBitTestAndSet into its own test file
authorEhsan Akhgari <ehsan.akhgari@gmail.com>
Sun, 6 Jul 2014 18:45:44 +0000 (18:45 +0000)
committerEhsan Akhgari <ehsan.akhgari@gmail.com>
Sun, 6 Jul 2014 18:45:44 +0000 (18:45 +0000)
Summary:
This gives us back the test coverage we lost when I made
MicrosoftExtensions.c x86-only.

Reviewers: majnemer

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4401

llvm-svn: 212414

clang/test/Parser/MicrosoftExtensions.c
clang/test/Parser/MicrosoftExtensionsInlineAsm.c [new file with mode: 0644]

index e41028c..6ffb0ea 100644 (file)
@@ -1,4 +1,3 @@
-// REQUIRES: x86-registered-target
 // RUN: %clang_cc1 -triple i386-mingw32 -fsyntax-only -verify -fms-extensions  -Wno-missing-declarations -x objective-c++ %s
 __stdcall int func0();
 int __stdcall func();
@@ -19,16 +18,6 @@ void * __ptr32 PtrToPtr32(const void *p)
   return((void * __ptr32) (unsigned __int32) (ULONG_PTR)p );
 }
 
-void __forceinline InterlockedBitTestAndSet (long *Base, long Bit)
-{
-  __asm {
-    mov eax, Bit
-    mov ecx, Base
-    lock bts [ecx], eax
-    setc al
-  };
-}
-
 // Both inline and __forceinline is OK.
 inline void __forceinline pr8264() {
 }
diff --git a/clang/test/Parser/MicrosoftExtensionsInlineAsm.c b/clang/test/Parser/MicrosoftExtensionsInlineAsm.c
new file mode 100644 (file)
index 0000000..2f5648f
--- /dev/null
@@ -0,0 +1,13 @@
+// REQUIRES: x86-registered-target
+// RUN: %clang_cc1 -triple i386-mingw32 -fsyntax-only -verify -fms-extensions  -Wno-missing-declarations -x objective-c++ %s
+// expected-no-diagnostics
+
+void __forceinline InterlockedBitTestAndSet (long *Base, long Bit)
+{
+  __asm {
+    mov eax, Bit
+    mov ecx, Base
+    lock bts [ecx], eax
+    setc al
+  };
+}