Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / partition-move-to-main-startstop.s
blob76c04957b3f729865520bb61918430f4a7a59ec9
1 // REQUIRES: x86
2 // RUN: llvm-mc %s -o %t.o -filetype=obj --triple=x86_64-unknown-linux
3 // RUN: ld.lld %t.o -o %t --export-dynamic --gc-sections
4 // RUN: llvm-readelf -S %t | FileCheck --implicit-check-not=has_startstop %s
6 // We can't let the has_startstop section be split by partition because it is
7 // referenced by __start_ and __stop_ symbols, so the split could result in
8 // some sections being moved out of the __start_/__stop_ range. Make sure that
9 // that didn't happen by checking that there is only one section.
11 // It's fine for us to split no_startstop because of the lack of
12 // __start_/__stop_ symbols.
14 // CHECK: has_startstop
15 // CHECK: no_startstop
17 // CHECK: no_startstop
19 .section .llvm_sympart.f1,"",@llvm_sympart
20 .asciz "part1"
21 .quad f1
23 .section .text._start,"ax",@progbits
24 .globl _start
25 _start:
26 call __start_has_startstop
27 call __stop_has_startstop
29 .section .text.f1,"ax",@progbits
30 .globl f1
31 f1:
33 .section has_startstop,"ao",@progbits,.text._start,unique,1
34 .quad 1
36 .section has_startstop,"ao",@progbits,.text.f1,unique,2
37 .quad 2
39 .section no_startstop,"ao",@progbits,.text._start,unique,1
40 .quad 3
42 .section no_startstop,"ao",@progbits,.text.f1,unique,2
43 .quad 4