1; RUN: llc -mtriple=arm64-apple-ios < %s | FileCheck %s 2; RUN: llc -mtriple=arm64-linux-gnu -relocation-model=pic < %s | FileCheck %s --check-prefix=CHECK-LINUX 3; <rdar://problem/11392109> 4 5define hidden void @t(i64* %addr) optsize ssp { 6entry: 7 store i64 zext (i32 ptrtoint (i64 (i32)* @x to i32) to i64), i64* %addr, align 8 8; CHECK: adrp x{{[0-9]+}}, _x@GOTPAGE 9; CHECK: ldr x{{[0-9]+}}, [x{{[0-9]+}}, _x@GOTPAGEOFF] 10; CHECK-NEXT: and x{{[0-9]+}}, x{{[0-9]+}}, #0xffffffff 11; CHECK-NEXT: str x{{[0-9]+}}, [x{{[0-9]+}}] 12 ret void 13} 14 15declare i64 @x(i32) optsize 16 17; Worth checking the Linux code is sensible too: only way to access 18; the GOT is via a 64-bit load. Just loading wN is unacceptable 19; (there's no ELF relocation to do that). 20 21; CHECK-LINUX: adrp {{x[0-9]+}}, :got:x 22; CHECK-LINUX: ldr {{x[0-9]+}}, [{{x[0-9]+}}, :got_lo12:x] 23