1 ; RUN: llc -mtriple=aarch64-none-eabi -code-model=tiny < %s | FileCheck %s
8 define i8* @global_addr() {
9 ; CHECK-LABEL: global_addr:
11 ; The adr calculation should end up returned directly in x0.
16 define i8 @global_i8() {
17 ; CHECK-LABEL: global_i8:
18 %val = load i8, i8* @var8
20 ; CHECK: adr x[[ADDR_REG:[0-9]+]], var8
21 ; CHECK: ldrb w0, [x[[ADDR_REG]]]
24 define i16 @global_i16() {
25 ; CHECK-LABEL: global_i16:
26 %val = load i16, i16* @var16
28 ; CHECK: adr x[[ADDR_REG:[0-9]+]], var16
29 ; CHECK: ldrh w0, [x[[ADDR_REG]]]
32 define i32 @global_i32() {
33 ; CHECK-LABEL: global_i32:
34 %val = load i32, i32* @var32
36 ; CHECK: ldr w0, var32
39 define i64 @global_i64() {
40 ; CHECK-LABEL: global_i64:
41 %val = load i64, i64* @var64
43 ; CHECK: ldr x0, var64
46 define <2 x i64> @constpool() {
47 ; CHECK-LABEL: constpool:
48 ret <2 x i64> <i64 123456789, i64 987654321100>
50 ; CHECK: adr x[[ADDR_REG:[0-9]+]], {{.LCPI[0-9]+_[0-9]+}}
51 ; CHECK: ldr q0, [x[[ADDR_REG]]]