ARM: lower tail calls correctly when using GHC calling convention.

Patch by Ben Gamari.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223055 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Tim Northover
2014-12-01 17:46:39 +00:00
parent c9605b6067
commit f7f88095a3
3 changed files with 76 additions and 38 deletions

View File

@@ -0,0 +1,21 @@
; RUN: llc -mtriple=thumbv7-eabi -o - %s | FileCheck %s
declare cc 10 void @g()
define cc 10 void @test_direct_tail() {
; CHECK-LABEL: test_direct_tail:
; CHECK: b g
tail call cc10 void @g()
ret void
}
@ind_func = global void()* zeroinitializer
define cc 10 void @test_indirect_tail() {
; CHECK-LABEL: test_indirect_tail:
; CHECK: bx {{r[0-9]+}}
%func = load void()** @ind_func
tail call cc10 void()* %func()
ret void
}