[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / riscv64-reloc-got32-pcrel.s
blob24bd828235b25d3e5af83eb4b9357989b539a0e8
1 // REQUIRES: riscv
2 // RUN: llvm-mc -filetype=obj -triple=riscv64 %s -o %t.o
3 // RUN: ld.lld %t.o -o %t.so -shared --noinhibit-exec 2>&1 | FileCheck %s --check-prefix=WARN
4 // RUN: llvm-readelf -S %t.so | FileCheck --check-prefix=SEC %s
5 // RUN: llvm-objdump --no-print-imm-hex -s -d %t.so | FileCheck %s
7 // SEC: .got PROGBITS 0000000000002390
9 .section .data
10 .globl bar
11 bar:
13 .globl _start
14 _start: // PC = 0x33a8
15 // bar@GOTPCREL = 0x2398 (got entry for `bar`) - 0x33a8 (.) = 0xf0efffff
16 // bar@GOTPCREL+4 = 0x2398 (got entry for `bar`) - 0x33ac (.) + 4 = 0xf0efffff
17 // bar@GOTPCREL-4 = 0x2398 (got entry for `bar`) - 0x33b0 (.) - 4 = 0xe4efffff
18 // CHECK: Contents of section .data:
19 // CHECK-NEXT: {{.*}} f0efffff f0efffff e4efffff
20 .word bar@GOTPCREL
21 .word bar@GOTPCREL+4
22 .word bar@GOTPCREL-4
24 // WARN: relocation R_RISCV_GOT32_PCREL out of range: {{.*}} is not in [-2147483648, 2147483647]; references 'baz'
25 // WARN: relocation R_RISCV_GOT32_PCREL out of range: {{.*}} is not in [-2147483648, 2147483647]; references 'baz'
26 .word baz@GOTPCREL+0xffffffff
27 .word baz@GOTPCREL-0xffffffff