2 # RUN: rm -rf %t && split-file %s %t
4 # RUN: llvm-mc --filetype=obj --triple=loongarch32 %t/32.s -o %t/32.o
5 # RUN: llvm-mc --filetype=obj --triple=loongarch64 %t/64.s -o %t/64.o
6 # RUN: ld.lld -shared %t/32.o -o %t/32.so
7 # RUN: llvm-nm %t/32.so | FileCheck --check-prefix=NM32 %s
8 # RUN: llvm-readobj -r %t/32.so | FileCheck --check-prefix=RELOC32 %s
9 # RUN: ld.lld -shared %t/64.o -o %t/64.so
10 # RUN: llvm-nm %t/64.so | FileCheck --check-prefix=NM64 %s
11 # RUN: llvm-readobj -r %t/64.so | FileCheck --check-prefix=RELOC64 %s
13 ## R_LARCH_32 and R_LARCH_64 are absolute relocation types.
14 ## In PIC mode, they create relative relocations if the symbol is non-preemptable.
19 # RELOC32: .rela.dyn {
20 # RELOC32-NEXT: 0x301FC R_LARCH_RELATIVE - 0x301FC
21 # RELOC32-NEXT: 0x301F8 R_LARCH_32 a 0
23 # RELOC64: .rela.dyn {
24 # RELOC64-NEXT: 0x30350 R_LARCH_RELATIVE - 0x30350
25 # RELOC64-NEXT: 0x30348 R_LARCH_64 a 0