llvm-project/llvm/test/CodeGen/AArch64/extern-weak.ll

14 lines
360 B
LLVM
Raw Normal View History

; RUN: llc -mtriple=aarch64-none-linux-gnu -o - < %s | FileCheck %s
declare extern_weak i32 @var()
define i32()* @foo() {
; The usual ADRP/ADD pair can't be used for a weak reference because it must
; evaluate to 0 if the symbol is undefined. We use a litpool entry.
ret i32()* @var
; CHECK: ldr x0, .LCPI0_0
; CHECK: .LCPI0_0:
; CHECK-NEXT: .xword var
}