2013-02-14 03:45:08 +00:00
|
|
|
; RUN: llc < %s -mtriple=i686-unknown-linux -tailcallopt | FileCheck %s
|
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
|
2013-02-14 03:45:08 +00:00
|
|
|
; CHECK: tailcallee
|
|
|
|
; CHECK: movl 4(%esp), %eax
|
2007-11-10 10:48:01 +00:00
|
|
|
}
|
|
|
|
|
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
|
2013-02-14 03:45:08 +00:00
|
|
|
; CHECK: tailcaller
|
|
|
|
; CHECK: jmp tailcallee
|
2007-11-10 10:48:01 +00:00
|
|
|
}
|