Lower thumbv4t & thumbv5 lo->lo copies through a push-pop sequence
[oota-llvm.git] / test / CodeGen / AArch64 / fast-isel-compute-address.ll
1 ; RUN: llc -fast-isel -fast-isel-abort -mtriple=arm64-apple-darwin < %s | FileCheck %s
2
3 ; Test simple constant offset.
4 define i64 @test_load1(i64 %a) {
5 ; CHECK-LABEL: test_load1
6 ; CHECK: ldr  x0, [x0, #16]
7   %1 = add i64 %a, 16
8   %2 = inttoptr i64 %1 to i64*
9   %3 = load i64* %2
10   ret i64 %3
11 }
12
13 ; Test large constant offset.
14 define i64 @test_load2(i64 %a) {
15 ; CHECK-LABEL: test_load2
16 ; CHECK: add [[REG:x[0-9]+]], x0, {{x[0-9]+}}
17 ; CHECK: ldr  x0, {{\[}}[[REG]]{{\]}}
18   %1 = add i64 %a, 16777216
19   %2 = inttoptr i64 %1 to i64*
20   %3 = load i64* %2
21   ret i64 %3
22 }
23