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