1 ;RUN: llc -mtriple=x86_64-unknown-unknown -filetype=asm -x86-asm-syntax=intel < %s | FileCheck %s --check-prefix=CHECK
4 ;Compile it with: "clang -O1 -emit-llvm"
11 ;char* test057(long long x) {
12 ; asm ("movq %1, %%rax;"
21 ; :"%rax", "%rcx", "%rdx"
26 ; CHECK: mov rax, offset Z
27 ; CHECK: push offset Y
29 ; CHECK: mov qword ptr [PY], rcx
30 ; CHECK: mov rdx, offset X
31 ; CHECK: mov qword ptr [PX], rdx
33 @PZ = common dso_local global ptr null, align 8
34 @Z = common dso_local global [4 x i8] zeroinitializer, align 1
35 @X = common dso_local global [4 x i8] zeroinitializer, align 1
36 @PX = common dso_local global ptr null, align 8
37 @Y = common dso_local global [4 x i8] zeroinitializer, align 1
38 @PY = common dso_local global ptr null, align 8
40 define dso_local ptr @test057(i64 %x) {
42 %x.addr = alloca i64, align 8
43 store i64 %x, ptr %x.addr, align 8
44 %0 = call ptr asm "movq $1, %rax;movq %rax, $0;pushq $$Y;popq %rcx;movq %rcx, PY;movq $$X, %rdx;movq %rdx, PX;", "=r,im,~{rax},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"(ptr @Z)
45 store ptr %0, ptr @PZ, align 8
46 %1 = load ptr, ptr @PZ, align 8