Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / loongarch-reloc-pic.s
blobb23ad55a2523853169b04840ded22b30e6339fad
1 # REQUIRES: loongarch
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.
16 # NM32: 000301fc d b
17 # NM64: 00030350 d b
19 # RELOC32: .rela.dyn {
20 # RELOC32-NEXT: 0x301FC R_LARCH_RELATIVE - 0x301FC
21 # RELOC32-NEXT: 0x301F8 R_LARCH_32 a 0
22 # RELOC32-NEXT: }
23 # RELOC64: .rela.dyn {
24 # RELOC64-NEXT: 0x30350 R_LARCH_RELATIVE - 0x30350
25 # RELOC64-NEXT: 0x30348 R_LARCH_64 a 0
26 # RELOC64-NEXT: }
28 #--- 32.s
29 .globl a, b
30 .hidden b
32 .data
33 .long a
35 .long b
37 #--- 64.s
38 .globl a, b
39 .hidden b
41 .data
42 .quad a
44 .quad b