Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / unique-orphans.s
blobd4623a91ecbc46f31b1503ba8efa082e762bcb16
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
4 .section .foo,"a",@progbits,unique,1
5 .byte 1
7 .section .foo,"a",@progbits,unique,2
8 .byte 2
10 .section .foo,"a",@progbits,unique,3
11 .byte 3
13 ## We should have 3 instances of orphan section foo.
14 ## Test with -r
15 # RUN: ld.lld %t.o -o %t.elf --unique
16 # RUN: llvm-readelf -S %t.elf | FileCheck %s
18 # CHECK-COUNT-3: .foo
19 # CHECK-NOT: .foo
21 ## Test that --unique does not affect sections specified in output section descriptions.
22 # RUN: echo 'SECTIONS { .foo : { *(.foo) }}' > %t.script
23 # RUN: ld.lld %t.o -o %t2.elf -T %t.script --unique
24 # RUN: llvm-readelf -S %t2.elf | FileCheck --check-prefix SCRIPT %s
25 # SCRIPT: .foo
26 # SCRIPT-NOT: .foo