AArch64/ARM64: add another set of tests from AArch64
[oota-llvm.git] / test / CodeGen / AArch64 / regress-tail-livereg.ll
1 ; RUN: llc -verify-machineinstrs -mtriple=aarch64-none-linux-gnu < %s | FileCheck %s
2 ; RUN: llc -verify-machineinstrs -mtriple=arm64-apple-ios7.0 -o - %s | FileCheck %s
3 @var = global void()* zeroinitializer
4
5 declare void @bar()
6
7 define void @foo() {
8 ; CHECK-LABEL: foo:
9        %func = load void()** @var
10
11        ; Calling a function encourages @foo to use a callee-saved register,
12        ; which makes it a natural choice for the tail call itself. But we don't
13        ; want that: the final "br xN" has to use a temporary or argument
14        ; register.
15        call void @bar()
16
17        tail call void %func()
18 ; CHECK: br {{x([0-79]|1[0-8])}}
19        ret void
20 }