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 global i8* null, align 8
34 @Z = common global [4 x i8] zeroinitializer, align 1
35 @X = common global [4 x i8] zeroinitializer, align 1
36 @PX = common global i8* null, align 8
37 @Y = common global [4 x i8] zeroinitializer, align 1
38 @PY = common global i8* null, align 8
40 define i8* @test057(i64 %x) {
42 %x.addr = alloca i64, align 8
43 store i64 %x, i64* %x.addr, align 8
44 %0 = call i8* 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}"(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @Z, i32 0, i32 0))
45 store i8* %0, i8** @PZ, align 8
46 %1 = load i8*, i8** @PZ, align 8