Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / gc-sections-linkorder.s
blob04b2a18dc92f955979383f82bea27fd4701f2146
1 # REQUIRES: x86
3 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
4 # RUN: ld.lld --gc-sections --print-gc-sections %t.o -o /dev/null | FileCheck %s --implicit-check-not=removing
6 # CHECK: removing unused section {{.*}}.o:(.foo2)
7 # CHECK: removing unused section {{.*}}.o:(bar2)
8 # CHECK: removing unused section {{.*}}.o:(.init_array.bar2)
9 # CHECK: removing unused section {{.*}}.o:(.zed2)
11 .global _start
12 _start:
13 .quad .foo1
15 .section .foo1,"a"
16 .quad 0
18 .section .foo2,"a"
19 .quad 0
21 .section bar1,"ao",@progbits,.foo1
22 .quad .zed1
23 .quad .foo1
25 .section bar2,"ao",@progbits,.foo2
26 .quad .zed2
27 .quad .foo2
29 ## An SHT_INIT_ARRAY with the SHF_LINK_ORDER flag can be GCed.
30 .section .init_array.bar2,"awo",@init_array,.foo2
31 .quad .zed2
32 .quad .foo2
34 .section .zed1,"a"
35 .quad 0
37 .section .zed2,"a"
38 .quad 0