Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / linkerscript / discard-plt.s
blobeef04eadd8171e50e9905fa2774eb81889596858
1 # REQUIRES: x86
2 # RUN: split-file %s %t
3 # RUN: llvm-mc -filetype=obj -triple=x86_64 %t/a.s -o %t/a.o
5 ## Discard .plt, .iplt, and .got.plt
6 # RUN: ld.lld -shared -T %t/t %t/a.o -o %t/a
7 # RUN: llvm-readelf -S -d %t/a > %t/readelf.txt
8 # RUN: FileCheck %s --input-file %t/readelf.txt
9 # RUN: FileCheck %s --input-file %t/readelf.txt --check-prefix=NEG
11 # CHECK: [Nr] Name Type Address Off Size ES Flg Lk Inf Al
12 # CHECK: ] .rela.plt RELA [[#%x,]] [[#%x,]] 000018 18 A 1 0 8
14 # CHECK: (PLTGOT) 0x0
15 # CHECK: (PLTREL) RELA
17 # NEG-NOT: ] .plt
18 # NEG-NOT: ] .iplt
19 # NEG-NOT: ] .got.plt
21 #--- a.s
22 call foo
23 call ifunc
25 .type ifunc, @gnu_indirect_function
26 .hidden ifunc
27 ifunc:
28 ret
30 .data
31 .quad ifunc
33 #--- t
34 SECTIONS {
35 .text : { *(.text) }
36 /DISCARD/ : { *(.plt .iplt .got.plt) }