summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/AArch64/regress-tail-livereg.ll
blob: e32ac8458f930399be596bee50278c91a11b5ca9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
; RUN: llc -verify-machineinstrs -mtriple=arm64-apple-ios7.0 -o - %s | FileCheck %s
@var = global void()* zeroinitializer

declare void @bar()

define void @foo() {
; CHECK-LABEL: foo:
       %func = load void()** @var

       ; Calling a function encourages @foo to use a callee-saved register,
       ; which makes it a natural choice for the tail call itself. But we don't
       ; want that: the final "br xN" has to use a temporary or argument
       ; register.
       call void @bar()

       tail call void %func()
; CHECK: br {{x([0-79]|1[0-8])}}
       ret void
}