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:
7 ; CHECK: adrp x[[GOTHI:[0-9]+]], :got:var
8 ; CHECK-NEXT: ldr x[[GOTLOC:[0-9]+]], [x[[GOTHI]], :got_lo12:var]
9 ; CHECK-NEXT: ldr w0, [x[[GOTLOC]]]
11 %val = load i32, ptr @var
15 define ptr @get_globalvaraddr() {
16 ; CHECK-LABEL: get_globalvaraddr:
17 ; CHECK: adrp x[[GOTHI:[0-9]+]], :got:var
18 ; CHECK-NEXT: ldr x0, [x[[GOTHI]], :got_lo12:var]
20 %val = load i32, ptr @var