Author: mcrosier
Date: Tue Apr 2 15:03:29 2013
New Revision: 178568
URL: http://llvm.org/viewvc/llvm-project?rev=178568&view=rev
Log:
[ms-inline asm] Test case for r178566.
Added:
cfe/trunk/test/CodeGen/ms-inline-asm.cpp
Added: cfe/trunk/test/CodeGen/ms-inline-asm.cpp
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-inline-asm.cpp?rev=178568&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/ms-inline-asm.cpp (added)
+++ cfe/trunk/test/CodeGen/ms-inline-asm.cpp Tue Apr 2 15:03:29 2013
@@ -0,0 +1,26 @@
+// REQUIRES: x86-64-registered-target
+// RUN: %clang_cc1 -x c++ %s -triple i386-apple-darwin10 -O0 -fasm-blocks
-emit-llvm -o - | FileCheck %s
+
+struct Foo {
+ static int *ptr;
+ static int a, b;
+ struct Bar {
+ static int *ptr;
+ };
+};
+
+void t1() {
+ Foo::ptr = (int *)0xDEADBEEF;
+ Foo::Bar::ptr = (int *)0xDEADBEEF;
+ __asm mov eax, Foo::ptr
+ __asm mov eax, Foo::Bar::ptr
+ __asm mov eax, [Foo::ptr]
+ __asm mov eax, dword ptr [Foo::ptr]
+ __asm mov eax, dword ptr [Foo::ptr]
+// CHECK: @_Z2t1v
+// CHECK: call void asm sideeffect inteldialect "mov eax, Foo::ptr",
"~{eax},~{dirflag},~{fpsr},~{flags}"()
+// CHECK: call void asm sideeffect inteldialect "mov eax, Foo::Bar::ptr",
"~{eax},~{dirflag},~{fpsr},~{flags}"()
+// CHECK: call void asm sideeffect inteldialect "mov eax, [Foo::ptr]",
"~{eax},~{dirflag},~{fpsr},~{flags}"()
+// CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr
[Foo::ptr]", "~{eax},~{dirflag},~{fpsr},~{flags}"()
+// CHECK: call void asm sideeffect inteldialect "mov eax, dword ptr
[Foo::ptr]", "~{eax},~{dirflag},~{fpsr},~{flags}"()
+}
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits