From c72c57c9e9b69944e3e009cd5e209634839581d3 Mon Sep 17 00:00:00 2001 From: dim Date: Mon, 8 Apr 2013 18:45:10 +0000 Subject: Vendor import of clang trunk r178860: http://llvm.org/svn/llvm-project/cfe/trunk@178860 --- test/CodeGen/ms-inline-asm.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/CodeGen/ms-inline-asm.cpp (limited to 'test/CodeGen/ms-inline-asm.cpp') diff --git a/test/CodeGen/ms-inline-asm.cpp b/test/CodeGen/ms-inline-asm.cpp new file mode 100644 index 0000000..9c160be --- /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}"() +} -- cgit v1.1