Xamarin Public Jenkins (auto-signing) 64ac736ec5 Imported Upstream version 6.0.0.172
Former-commit-id: f3cc9b82f3e5bd8f0fd3ebc098f789556b44e9cd
2019-04-12 14:10:50 +00:00

35 lines
779 B
LLVM

; RUN: opt < %s -globalopt -S | FileCheck %s
; PR36546
; Check that musttail callee preserves its calling convention
define i32 @test(i32 %a) {
; CHECK: %ca = musttail call i32 @foo(i32 %a)
%ca = musttail call i32 @foo(i32 %a)
ret i32 %ca
}
; CHECK-LABEL: define internal i32 @foo(i32 %a)
define internal i32 @foo(i32 %a) {
ret i32 %a
}
; Check that musttail caller preserves its calling convention
define i32 @test2(i32 %a) {
%ca = call i32 @foo1(i32 %a)
ret i32 %ca
}
; CHECK-LABEL: define internal i32 @foo1(i32 %a)
define internal i32 @foo1(i32 %a) {
; CHECK: %ca = musttail call i32 @foo2(i32 %a)
%ca = musttail call i32 @foo2(i32 %a)
ret i32 %ca
}
; CHECK-LABEL: define internal i32 @foo2(i32 %a)
define internal i32 @foo2(i32 %a) {
ret i32 %a
}