Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / linkerscript / discard-section-err.s
blob723d8111c61580b1d57db368019c1af927ccd980
1 # REQUIRES: x86
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
5 # RUN: echo "SECTIONS { /DISCARD/ : { *(.shstrtab) } }" > %t.script
6 # RUN: not ld.lld -o /dev/null --script %t.script %t.o 2>&1 | \
7 # RUN: FileCheck -check-prefix=SHSTRTAB %s
8 # SHSTRTAB: discarding .shstrtab section is not allowed
10 ## We allow discarding .dynamic, check we don't crash.
11 # RUN: echo "SECTIONS { /DISCARD/ : { *(.dynamic) } }" > %t.script
12 # RUN: ld.lld -pie -o %t --script %t.script %t.o
14 # RUN: echo "SECTIONS { /DISCARD/ : { *(.rela.dyn) } }" > %t.script
15 # RUN: ld.lld -pie -o %t %t.o
16 # RUN: llvm-readobj -S %t | FileCheck --check-prefix=RELADYN %s
17 # RELADYN: Name: .rela.dyn
18 # RUN: ld.lld -pie -o %t --script %t.script %t.o
19 # RUN: llvm-readobj -S %t | FileCheck /dev/null --implicit-check-not='Name: .rela.dyn'
21 # RUN: echo "SECTIONS { /DISCARD/ : { *(.relr.dyn) } }" > %t.script
22 # RUN: ld.lld -pie --pack-dyn-relocs=relr -T %t.script %t.o -o %t
23 # RUN: llvm-readobj -S -r %t | FileCheck /dev/null --implicit-check-not='Name: .relr.dyn' --implicit-check-not=R_X86_64_RELATIVE
25 .data
26 .align 8
27 foo:
28 ## Emits an R_X86_64_RELATIVE in -pie mode.
29 .quad foo