mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
We need support for tail calls, this is moved to PR1392
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36798 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2d4a5abb75
commit
60ef91a3ce
@ -1,25 +0,0 @@
|
||||
; XFAIL: *
|
||||
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep {jmp \\*ecx}
|
||||
declare int %putchar(int)
|
||||
|
||||
int %main(){
|
||||
%f = cast int (int, int*, int)* %check_tail to int*
|
||||
%res = tail call fastcc int %check_tail( int 10, int* %f,int 10)
|
||||
ret int %res
|
||||
}
|
||||
|
||||
fastcc int %check_tail(int %x, int* %f, int %g) {
|
||||
%tmp1 = setgt int %x, 0
|
||||
br bool %tmp1, label %if-then, label %if-else
|
||||
|
||||
if-then:
|
||||
%fun_ptr = cast int* %f to int(int, int*, int)*
|
||||
%arg1 = add int %x, -1
|
||||
call int %putchar(int 90)
|
||||
%res = tail call fastcc int %fun_ptr( int %arg1, int * %f, int %g)
|
||||
ret int %res
|
||||
|
||||
if-else:
|
||||
ret int %x
|
||||
}
|
||||
|
@ -1,8 +0,0 @@
|
||||
; XFAIL: *
|
||||
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | not grep call
|
||||
|
||||
fastcc int %bar(int %X, int(double, int) *%FP) {
|
||||
%Y = tail call fastcc int %FP(double 0.0, int %X)
|
||||
ret int %Y
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user