1 // REQUIRES: x86-registered-target
2 // RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -Wno-strict-prototypes -fasm-blocks -emit-llvm -o - | FileCheck %s
6 __asm mov rax
, offset var
; rax
= address of myvar
8 // CHECK: call void asm sideeffect inteldialect
9 // CHECK-SAME: mov rax, $0
10 // CHECK-SAME: "r,~{rax},~{dirflag},~{fpsr},~{flags}"(ptr %{{.*}})
15 __asm mov qword ptr
[eax
], offset var
17 // CHECK: call void asm sideeffect inteldialect
18 // CHECK-SAME: mov qword ptr [eax], $0
19 // CHECK-SAME: "r,~{dirflag},~{fpsr},~{flags}"(ptr %{{.*}})
22 struct t3_type
{ int a
, b
; };
35 // CHECK: call void asm sideeffect inteldialect
36 // CHECK-SAME: lea ebx, $0
37 // CHECK-SAME: mov eax, [ebx]
38 // CHECK-SAME: mov [ebx + $$4], ecx
39 // CHECK-SAME: "*m,~{eax},~{ebx},~{dirflag},~{fpsr},~{flags}"(ptr elementtype(%struct.t3_type) %{{.*}})
55 // CHECK: call void asm sideeffect inteldialect
56 // CHECK-SAME: lea ebx, $0
57 // CHECK-SAME: mov eax, [ebx]
58 // CHECK-SAME: mov [ebx + $$4], ecx
59 // CHECK-SAME: "*m,~{eax},~{ebx},~{dirflag},~{fpsr},~{flags}"(ptr elementtype(%struct.t3_type) %{{.*}})
63 static void (*fptr
)();
73 // CHECK: call void asm sideeffect inteldialect
74 // CHECK-SAME: call ${0:P}
75 // CHECK-SAME: jmp ${1:P}
76 // CHECK-SAME: call $2
78 // CHECK-SAME: "*m,*m,*m,*m,~{dirflag},~{fpsr},~{flags}"(ptr elementtype(void (...)) @bar, ptr elementtype(void (...)) @bar, ptr elementtype(ptr) @fptr, ptr elementtype(ptr) @fptr)
82 // CHECK-LABEL: define{{.*}} void @t47
84 __asm movdir64b rax
, zmmword ptr
[arr
]
85 // CHECK: call void asm sideeffect inteldialect "movdir64b rax, zmmword ptr $0", "*m,~{dirflag},~{fpsr},~{flags}"(ptr elementtype([1000 x i32]) %arr)