diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/X86/fast-isel-loads.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/X86/fast-isel-x86.ll | 33 | ||||
-rw-r--r-- | test/CodeGen/X86/fast-isel.ll | 14 |
3 files changed, 40 insertions, 9 deletions
diff --git a/test/CodeGen/X86/fast-isel-loads.ll b/test/CodeGen/X86/fast-isel-loads.ll index 027363e..2fbb46c 100644 --- a/test/CodeGen/X86/fast-isel-loads.ll +++ b/test/CodeGen/X86/fast-isel-loads.ll @@ -5,7 +5,7 @@ ; CHECK: foo: ; CHECK-NEXT: movq %rdi, -8(%rsp) ; CHECK-NEXT: movq %rsi, -16(%rsp) -; CHECK: movsd 128(%rsi,%rdi,8), %xmm0 +; CHECK-NEXT: movsd 128(%rsi,%rdi,8), %xmm0 ; CHECK-NEXT: ret define double @foo(i64 %x, double* %p) nounwind { diff --git a/test/CodeGen/X86/fast-isel-x86.ll b/test/CodeGen/X86/fast-isel-x86.ll new file mode 100644 index 0000000..f7dbe6e --- /dev/null +++ b/test/CodeGen/X86/fast-isel-x86.ll @@ -0,0 +1,33 @@ +; RUN: llc -march=x86 -relocation-model=pic + +; This should use flds to set the return value. +; CHECK: test0: +; CHECK: flds +; CHECK: ret +@G = external global float +define float @test0() nounwind { + %t = load float* @G + ret float %t +} + +; This should pop 4 bytes on return. +; CHECK: test1: +; CHECK: ret $4 +define void @test1({i32, i32, i32, i32}* sret %p) nounwind { + store {i32, i32, i32, i32} zeroinitializer, {i32, i32, i32, i32}* %p + ret void +} + +; Properly initialize the pic base. +; CHECK: test2: +; CHECK-NOT: HHH +; CHECK: call{{.*}}L2$pb +; CHECK-NEXT: L2$pb: +; CHECK-NEXT: pop +; CHECK: HHH +; CHECK: ret +@HHH = external global i32 +define i32 @test2() nounwind { + %t = load i32* @H + ret i32 %t +} diff --git a/test/CodeGen/X86/fast-isel.ll b/test/CodeGen/X86/fast-isel.ll index 3d26ae7..177c06b 100644 --- a/test/CodeGen/X86/fast-isel.ll +++ b/test/CodeGen/X86/fast-isel.ll @@ -49,9 +49,10 @@ entry: ret i32 %tmp2 } -define i1 @ptrtoint_i1(i8* %p) nounwind { +define void @ptrtoint_i1(i8* %p, i1* %q) nounwind { %t = ptrtoint i8* %p to i1 - ret i1 %t + store i1 %t, i1* %q + ret void } define i8* @inttoptr_i1(i1 %p) nounwind { %t = inttoptr i1 %p to i8* @@ -86,11 +87,8 @@ define i8 @mul_i8(i8 %a) nounwind { ret i8 %tmp } -define void @store_i1(i1* %p, i1 %t) nounwind { - store i1 %t, i1* %p - ret void -} -define i1 @load_i1(i1* %p) nounwind { +define void @load_store_i1(i1* %p, i1* %q) nounwind { %t = load i1* %p - ret i1 %t + store i1 %t, i1* %q + ret void } |