summaryrefslogtreecommitdiffstats
path: root/clang/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
commit3b7b0cd8374c2faf0c12d18f2d1da342b6263817 (patch)
tree0048a4f07e1e98ced92a19a8405733a3ee45bb6f /clang/test/CodeGen/ms-inline-asm.cpp
parent09da37d10d006dc476af599076dc5d911e0db8e9 (diff)
downloadbcm5719-llvm-3b7b0cd8374c2faf0c12d18f2d1da342b6263817.tar.gz
bcm5719-llvm-3b7b0cd8374c2faf0c12d18f2d1da342b6263817.zip
[ms-inline asm] Test case for r178566.
llvm-svn: 178568
Diffstat (limited to 'clang/test/CodeGen/ms-inline-asm.cpp')
-rw-r--r--clang/test/CodeGen/ms-inline-asm.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/clang/test/CodeGen/ms-inline-asm.cpp b/clang/test/CodeGen/ms-inline-asm.cpp
new file mode 100644
index 00000000000..9c160be02fd
--- /dev/null
+++ b/clang/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}"()
+}
OpenPOWER on IntegriCloud