blob: 916be566a14a34ddea09588fb62531c47359418c [file] [log] [blame]
Arnold Schwaighofer97794942007-11-10 10:48:01 +00001; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep TAILCALL
Dan Gohman1e5f9a72008-12-03 01:28:04 +00002; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep {movl\[\[:space:\]\]*4(%esp), %eax} | count 1
Arnold Schwaighofera38df102008-04-12 18:11:06 +00003%struct.s = type {i32, i32, i32, i32, i32, i32, i32, i32,
4 i32, i32, i32, i32, i32, i32, i32, i32,
5 i32, i32, i32, i32, i32, i32, i32, i32 }
Arnold Schwaighofer97794942007-11-10 10:48:01 +00006
Dan Gohmanbafd3872008-12-03 01:10:18 +00007define fastcc i32 @tailcallee(%struct.s* byval %a) nounwind {
Arnold Schwaighofer97794942007-11-10 10:48:01 +00008entry:
9 %tmp2 = getelementptr %struct.s* %a, i32 0, i32 0
10 %tmp3 = load i32* %tmp2
11 ret i32 %tmp3
12}
13
Dan Gohmanbafd3872008-12-03 01:10:18 +000014define fastcc i32 @tailcaller(%struct.s* byval %a) nounwind {
Arnold Schwaighofer97794942007-11-10 10:48:01 +000015entry:
16 %tmp4 = tail call fastcc i32 @tailcallee(%struct.s* %a byval)
17 ret i32 %tmp4
18}