[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / riscv-pcrel-hilo-error-sections.s
blobebdefd357d722db39e20792b49ff1373eb268160
1 # REQUIRES: riscv
3 # RUN: llvm-mc -filetype=obj -triple=riscv64 %s -o %t.o
4 # RUN: not ld.lld %t.o 2>&1 | FileCheck %s
6 # CHECK: error: {{.*}}:(.text.sec_one+0x0): R_RISCV_PCREL_LO12 relocation points to a symbol '.Lpcrel_hi0' in a different section '.text.sec_two'
7 # CHECK: error: {{.*}}:(.text.sec_one+0x4): R_RISCV_PCREL_LO12 relocation points to a symbol '.Lpcrel_hi1' in a different section '.text.sec_two'
8 # CHECK-NOT: R_RISCV_PCREL_LO12 relocation points to a symbol '.Lpcrel_hi2'
10 ## This test is checking that we warn the user when the relocations in their
11 ## object don't follow the RISC-V psABI. In particular, the psABI requires
12 ## that PCREL_LO12 relocations are in the same section as the pcrel_hi
13 ## instruction they point to.
15 .section .text.sec_one,"ax"
16 addi a0, a0, %pcrel_lo(.Lpcrel_hi0)
17 sw a0, %pcrel_lo(.Lpcrel_hi1)(a1)
19 .section .text.sec_two,"ax"
20 .Lpcrel_hi0:
21 auipc a0, %pcrel_hi(a)
22 .Lpcrel_hi1:
23 auipc a1, %pcrel_hi(a)
25 .Lpcrel_hi2:
26 auipc a2, %pcrel_hi(a)
27 addi a2, a2, %pcrel_lo(.Lpcrel_hi2)
29 .data
30 .global a
32 .word 50