Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / x86-64-reloc-pltoff64.s
blob03c6b0be340136f47c58ee82e1ed13a2cb4fcd85
1 # REQUIRES: x86
2 ## Test R_X86_64_PLTOFF64 (preemptible: L - GOT + A; non-preemptible: S - GOT + A).
4 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
5 # RUN: ld.lld %t.o -shared -o %t.so
6 # RUN: llvm-readelf -S %t.so | FileCheck %s --check-prefix=SEC-SHARED
7 # RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.so | FileCheck %s --check-prefix=SHARED
9 # RUN: ld.lld %t.o -o %t
10 # RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=SEC-PDE
11 # RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t | FileCheck %s --check-prefix=PDE
13 # SEC-SHARED: .got.plt PROGBITS 00000000000033c0 0003c0 000028
15 ## foo@plt - .got.plt = 0x12f0 - 0x33c0 = -8400
16 ## undefweak@plt - .got.plt = 0x1300 - 0x33c0 = -8384
17 # SHARED-LABEL: <.text>:
18 # SHARED-NEXT: movabsq $-8400, %rdx
19 # SHARED-NEXT: movabsq $-8384, %rdx
20 # SHARED-LABEL: <foo@plt>:
21 # SHARED-NEXT: 12f0: jmpq {{.*}}(%rip)
23 # SEC-PDE: .got.plt PROGBITS 0000000000202170 000170 000018
25 ## Avoid PLT since the referenced symbol is non-preemptible.
26 ## foo - .got.plt = 0x20116c - 0x202170 = -4100
27 ## 0 - .got.plt = 0 - 0x202168 = -2105712
28 # PDE-LABEL: <.text>:
29 # PDE-NEXT: movabsq $-4100, %rdx
30 # PDE-NEXT: movabsq $-2105712, %rdx
31 # PDE-LABEL: <foo>:
32 # PDE-NEXT: 20116c: retq
34 movabsq $foo@PLTOFF, %rdx
35 movabsq $undefweak@PLTOFF, %rdx
37 .globl foo
38 foo:
39 ret
41 .weak undefweak