llvm-project/llvm/test/CodeGen/X86/tailcallfp2.ll
Nikita Popov 2f448bf509 [X86] Migrate tests to use opaque pointers (NFC)
Test updates were performed using:
https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34

These are only the test updates where the test passed without
further modification (which is almost all of them, as the backend
is largely pointer-type agnostic).
2022-06-22 14:38:25 +02:00

26 lines
615 B
LLVM

; RUN: llc < %s -mtriple=i686-- -tailcallopt | FileCheck %s
declare i32 @putchar(i32)
define fastcc i32 @checktail(i32 %x, ptr %f, i32 %g) nounwind {
; CHECK-LABEL: checktail:
%tmp1 = icmp sgt i32 %x, 0
br i1 %tmp1, label %if-then, label %if-else
if-then:
%arg1 = add i32 %x, -1
call i32 @putchar(i32 90)
; CHECK: jmpl *%e{{.*}}
%res = tail call fastcc i32 %f( i32 %arg1, ptr %f, i32 %g)
ret i32 %res
if-else:
ret i32 %x
}
define i32 @main() nounwind {
%res = tail call fastcc i32 @checktail( i32 10, ptr @checktail,i32 10)
ret i32 %res
}