2007-11-10 10:48:01 +00:00
|
|
|
; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep TAILCALL
|
2008-12-03 01:28:04 +00:00
|
|
|
; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep {movl\[\[:space:\]\]*4(%esp), %eax} | count 1
|
2008-04-12 18:11:06 +00:00
|
|
|
%struct.s = type {i32, i32, i32, i32, i32, i32, i32, i32,
|
|
|
|
i32, i32, i32, i32, i32, i32, i32, i32,
|
|
|
|
i32, i32, i32, i32, i32, i32, i32, i32 }
|
2007-11-10 10:48:01 +00:00
|
|
|
|
2008-12-03 01:10:18 +00:00
|
|
|
define fastcc i32 @tailcallee(%struct.s* byval %a) nounwind {
|
2007-11-10 10:48:01 +00:00
|
|
|
entry:
|
|
|
|
%tmp2 = getelementptr %struct.s* %a, i32 0, i32 0
|
|
|
|
%tmp3 = load i32* %tmp2
|
|
|
|
ret i32 %tmp3
|
|
|
|
}
|
|
|
|
|
2008-12-03 01:10:18 +00:00
|
|
|
define fastcc i32 @tailcaller(%struct.s* byval %a) nounwind {
|
2007-11-10 10:48:01 +00:00
|
|
|
entry:
|
|
|
|
%tmp4 = tail call fastcc i32 @tailcallee(%struct.s* %a byval)
|
|
|
|
ret i32 %tmp4
|
|
|
|
}
|