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