aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/fast-isel-x86.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/X86/fast-isel-x86.ll')
-rw-r--r--test/CodeGen/X86/fast-isel-x86.ll33
1 files changed, 33 insertions, 0 deletions
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
+}