1 // REQUIRES: x86-registered-target
2 // RUN: %clang_cc1 %s -triple i386-apple-darwin10 -fasm-blocks -emit-llvm -o - | FileCheck %s
17 extern "C" int test_param_field(A p
) {
18 // CHECK: define{{.*}} i32 @test_param_field(ptr noundef byval(%struct.A) align 4 %p)
19 // CHECK: getelementptr inbounds %struct.A, ptr %p, i32 0, i32 0
20 // CHECK: call i32 asm sideeffect inteldialect "mov eax, $1"
25 extern "C" int test_namespace_global() {
26 // CHECK: define{{.*}} i32 @test_namespace_global()
27 // CHECK: call i32 asm sideeffect inteldialect "mov eax, $1", "{{.*}}"(ptr elementtype(i32) getelementptr inbounds (%struct.A, ptr @_ZN4asdf8a_globalE, i32 0, i32 2, i32 1))
29 __asm mov eax
, asdf::a_global
.a3
.b2
32 template <bool Signed
>
33 struct make_storage_type
{
42 template <bool Signed
>
43 struct msvc_dcas_x86
{
44 typedef typename make_storage_type
<Signed
>::type storage_type
;
45 void store() __asm("PR26001") {
51 template void msvc_dcas_x86
<false>::store();
52 // CHECK: define weak_odr void @"\01PR26001"(
53 // CHECK: %[[P:.*]] = alloca %"struct.make_storage_type<false>::type", align 4
54 // CHECK: %[[B:.*]] = getelementptr inbounds %"struct.make_storage_type<false>::type", ptr %[[P]], i32 0, i32 0
55 // CHECK: %[[X:.*]] = getelementptr inbounds %"struct.make_storage_type<false>::type::B", ptr %[[B]], i32 0, i32 1
56 // CHECK: call void asm sideeffect inteldialect "mov edx, dword ptr $0", "*m,~{edx},~{dirflag},~{fpsr},~{flags}"(ptr elementtype(i32) %[[X]])