2013-02-14 03:00:57 +00: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 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:
|
2011-06-17 03:14:27 +00:00
|
|
|
%tmp4 = tail call fastcc i32 @tailcallee(%struct.s* byval %a )
|
2007-11-10 10:48:01 +00:00
|
|
|
ret i32 %tmp4
|
|
|
|
}
|