From fc74ff5a0792641885551a63d9ddf8cbfdf76e3c Mon Sep 17 00:00:00 2001 From: dim Date: Wed, 6 Jan 2016 20:02:26 +0000 Subject: Vendor import of clang trunk r256945: https://llvm.org/svn/llvm-project/cfe/trunk@256945 --- test/CodeGenCXX/ms-inline-asm-fields.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test/CodeGenCXX/ms-inline-asm-fields.cpp') diff --git a/test/CodeGenCXX/ms-inline-asm-fields.cpp b/test/CodeGenCXX/ms-inline-asm-fields.cpp index a78d511..6f32933 100644 --- a/test/CodeGenCXX/ms-inline-asm-fields.cpp +++ b/test/CodeGenCXX/ms-inline-asm-fields.cpp @@ -29,3 +29,28 @@ extern "C" int test_namespace_global() { __asm mov eax, asdf::a_global.a3.b2 } +template +struct make_storage_type { + struct type { + struct B { + int a; + int x; + } b; + }; +}; + +template +struct msvc_dcas_x86 { + typedef typename make_storage_type::type storage_type; + void store() __asm("PR26001") { + storage_type p; + __asm mov edx, p.b.x; + } +}; + +template void msvc_dcas_x86::store(); +// CHECK: define weak_odr void @"\01PR26001"( +// CHECK: %[[P:.*]] = alloca %"struct.make_storage_type::type", align 4 +// CHECK: %[[B:.*]] = getelementptr inbounds %"struct.make_storage_type::type", %"struct.make_storage_type::type"* %[[P]], i32 0, i32 0 +// CHECK: %[[X:.*]] = getelementptr inbounds %"struct.make_storage_type::type::B", %"struct.make_storage_type::type::B"* %[[B]], i32 0, i32 1 +// CHECK: call void asm sideeffect inteldialect "mov edx, dword ptr $0", "*m,~{edx},~{dirflag},~{fpsr},~{flags}"(i32* %[[X]]) -- cgit v1.1