blob: 7002560c82a05cd7c5ac98e60a13b74e1d48ca36 [file] [log] [blame]
Dan Gohman0a063102009-09-08 23:54:48 +00001; RUN: llc < %s -march=x86 -tailcallopt | grep TAILCALL
2; RUN: llc < %s -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}