summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/ms-inline-asm-fields.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-01-04 23:51:15 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-01-04 23:51:15 +0000
commitf8b569c786778e421a6732e180e5504c309f3bcd (patch)
treebeb6259d854f068755c90842143158d07abf7492 /clang/test/CodeGenCXX/ms-inline-asm-fields.cpp
parent5b50497617957f3d18e337ce5d1acddd09853303 (diff)
downloadbcm5719-llvm-f8b569c786778e421a6732e180e5504c309f3bcd.tar.gz
bcm5719-llvm-f8b569c786778e421a6732e180e5504c309f3bcd.zip
[ms-inline-asm] Handle dependent identifiers in inline asm
Build up a dependent expression for MS-style inline assembly if the identifier's type is dependent. This fixes PR26001. llvm-svn: 256795
Diffstat (limited to 'clang/test/CodeGenCXX/ms-inline-asm-fields.cpp')
-rw-r--r--clang/test/CodeGenCXX/ms-inline-asm-fields.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/ms-inline-asm-fields.cpp b/clang/test/CodeGenCXX/ms-inline-asm-fields.cpp
index a78d511485a..6f329330bda 100644
--- a/clang/test/CodeGenCXX/ms-inline-asm-fields.cpp
+++ b/clang/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 <bool Signed>
+struct make_storage_type {
+ struct type {
+ struct B {
+ int a;
+ int x;
+ } b;
+ };
+};
+
+template <bool Signed>
+struct msvc_dcas_x86 {
+ typedef typename make_storage_type<Signed>::type storage_type;
+ void store() __asm("PR26001") {
+ storage_type p;
+ __asm mov edx, p.b.x;
+ }
+};
+
+template void msvc_dcas_x86<false>::store();
+// CHECK: define weak_odr void @"\01PR26001"(
+// CHECK: %[[P:.*]] = alloca %"struct.make_storage_type<false>::type", align 4
+// CHECK: %[[B:.*]] = getelementptr inbounds %"struct.make_storage_type<false>::type", %"struct.make_storage_type<false>::type"* %[[P]], i32 0, i32 0
+// CHECK: %[[X:.*]] = getelementptr inbounds %"struct.make_storage_type<false>::type::B", %"struct.make_storage_type<false>::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]])
OpenPOWER on IntegriCloud