14 lines · plain
1# REQUIRES: riscv2# RUN: llvm-mc -filetype=obj -triple=riscv64 %s -o %t.o3# RUN: not ld.lld %t.o --defsym external=0 2>&1 | FileCheck %s4 5# CHECK: error: {{.*}}:(.text+0x4): R_RISCV_PCREL_LO12 relocation points to an absolute symbol: external6 7# We provide a dummy %pcrel_hi referred to by external to appease the8# assembler, but make external weak so --defsym can still override it at link9# time.10.weak external11external:12auipc sp,%pcrel_hi(external)13addi sp,sp,%pcrel_lo(external)14