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