1; RUN: llc -mtriple=aarch64-none-linux-gnu -relocation-model=pic -o - %s | FileCheck %s 2; RUN: llc -mtriple=aarch64-none-linux-gnu -relocation-model=pic -filetype=obj -o - %s 3 4; LLVM gives well-defined semantics to this horrible construct (though C says 5; it's undefined). Regardless, we shouldn't crash. The important feature here is 6; that in general the only way to access a GOT symbol is via a 64-bit 7; load. Neither of these alternatives has the ELF relocations required to 8; support it: 9; + ldr wD, [xN, #:got_lo12:func] 10; + add xD, xN, #:got_lo12:func 11 12declare void @consume(i32) 13declare void @func() 14 15define void @foo() nounwind { 16; CHECK-LABEL: foo: 17entry: 18 call void @consume(i32 ptrtoint (void ()* @func to i32)) 19; CHECK: adrp x[[ADDRHI:[0-9]+]], :got:func 20; CHECK: ldr {{x[0-9]+}}, [x[[ADDRHI]], {{#?}}:got_lo12:func] 21 ret void 22} 23 24