mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-17 03:07:06 +00:00
e4300e271a
delegates to the regular x86-32 convention which handles byval, but only after it handles a few cases, and it's necessary to handle byval before handling those cases. This fixes PR3122 (and rdar://6400815), llvm-gcc miscompiling LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60453 91177308-0d34-0410-b5e6-96231b3b80d8
19 lines
694 B
LLVM
19 lines
694 B
LLVM
; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep TAILCALL
|
|
; RUN: llvm-as < %s | llc -march=x86 -tailcallopt | grep {movl\[\[:space:\]\]*4(%esp), %eax} | count 1
|
|
%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 }
|
|
|
|
define fastcc i32 @tailcallee(%struct.s* byval %a) nounwind {
|
|
entry:
|
|
%tmp2 = getelementptr %struct.s* %a, i32 0, i32 0
|
|
%tmp3 = load i32* %tmp2
|
|
ret i32 %tmp3
|
|
}
|
|
|
|
define fastcc i32 @tailcaller(%struct.s* byval %a) nounwind {
|
|
entry:
|
|
%tmp4 = tail call fastcc i32 @tailcallee(%struct.s* %a byval)
|
|
ret i32 %tmp4
|
|
}
|