1 ; RUN: llc -fast-isel -O0 -mcpu=generic -mtriple=i386-apple-darwin10 -relocation-model=pic < %s | FileCheck %s
3 ; This should use flds to set the return value.
7 @G = external global float
8 define float @test0() nounwind {
13 ; This should pop 4 bytes on return.
16 define void @test1({i32, i32, i32, i32}* sret %p) nounwind {
17 store {i32, i32, i32, i32} zeroinitializer, {i32, i32, i32, i32}* %p
21 ; Properly initialize the pic base.
24 ; CHECK: call{{.*}}L2$pb
29 @HHH = external global i32
30 define i32 @test2() nounwind {
35 ; Check that we fast-isel sret, and handle the callee-pops behavior correctly.
36 %struct.a = type { i64, i64, i64 }
37 define void @test3() nounwind ssp {
39 %tmp = alloca %struct.a, align 8
40 call void @test3sret(%struct.a* sret %tmp)
44 ; CHECK: leal 16(%esp)
45 ; CHECK: calll _test3sret
48 declare void @test3sret(%struct.a* sret)
50 ; Check that fast-isel sret works with fastcc (and does not callee-pop)
51 define void @test4() nounwind ssp {
53 %tmp = alloca %struct.a, align 8
54 call fastcc void @test4fastccsret(%struct.a* sret %tmp)
58 ; CHECK: leal (%esp), %ecx
59 ; CHECK: calll _test4fastccsret
62 declare fastcc void @test4fastccsret(%struct.a* sret)
65 ; Check that fast-isel cleans up when it fails to lower a call instruction.
66 define void @test5() {
68 %call = call i32 @test5dllimport(i32 42)
71 ; Local value area is still there:
72 ; CHECK: movl $42, {{%[a-z]+}}
73 ; Fast-ISel's arg push is not here:
74 ; CHECK-NOT: movl $42, (%esp)
75 ; SDag-ISel's arg push:
76 ; CHECK: movl %esp, [[REGISTER:%[a-z]+]]
77 ; CHECK: movl $42, ([[REGISTER]])
78 ; CHECK: movl __imp__test5dllimport
80 declare dllimport i32 @test5dllimport(i32)