aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/ms-inline-asm.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2013-04-02 20:03:29 +0000
committerChad Rosier <mcrosier@apple.com>2013-04-02 20:03:29 +0000
commit148bab27d31ff1ab2de52ee10e5e8cb3a52730e3 (patch)
treedabf42572e82a7df67318a55444710c5a1b45274 /test/CodeGen/ms-inline-asm.cpp
parent0ab5b4c438b40c72252933072d4c9e9a948106f0 (diff)
[ms-inline asm] Test case for r178566.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178568 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ms-inline-asm.cpp')
-rw-r--r--test/CodeGen/ms-inline-asm.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/CodeGen/ms-inline-asm.cpp b/test/CodeGen/ms-inline-asm.cpp
new file mode 100644
index 0000000000..9c160be02f
--- /dev/null
+++ b/test/CodeGen/ms-inline-asm.cpp
@@ -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}"()
+}