1 ; RUN: llc -mtriple=aarch64-linux-gnu -verify-machineinstrs -relocation-model=pic %s -o - | FileCheck %s
5 define i32 @get_globalvar() {
6 ; CHECK-LABEL: get_globalvar:
8 %val = load i32, ptr @var
9 ; CHECK: adrp x[[GOTHI:[0-9]+]], :got:var
10 ; CHECK: ldr x[[GOTLOC:[0-9]+]], [x[[GOTHI]], :got_lo12:var]
11 ; CHECK: ldr w0, [x[[GOTLOC]]]
16 define ptr @get_globalvaraddr() {
17 ; CHECK-LABEL: get_globalvaraddr:
19 %val = load i32, ptr @var
20 ; CHECK: adrp x[[GOTHI:[0-9]+]], :got:var
21 ; CHECK: ldr x0, [x[[GOTHI]], :got_lo12:var]