[clang-tidy][modernize-use-starts-ends-with] Fix operator rewriting false negative...
[llvm-project.git] / lld / test / ELF / emit-relocs-gc.s
blob06a11947b022a42c55bd06e754ec19e23c81152c
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
4 ## Show that we emit .rela.bar, .rela.text and .rela.debug_info when GC is disabled.
5 # RUN: ld.lld --emit-relocs %t.o -o %t
6 # RUN: llvm-objdump %t --section-headers | FileCheck %s --check-prefix=NOGC
7 # NOGC: .rela.text
8 # NOGC: .rela.bar
9 # NOGC: .rela.debug_info
11 ## GC collects .bar section and we exclude .rela.bar from output. We keep
12 ## .rela.text because we keep .text. We keep .rela.debug_info because we keep
13 ## non-SHF_ALLOC .debug_info.
14 # RUN: ld.lld --gc-sections --emit-relocs --print-gc-sections %t.o -o %t \
15 # RUN: | FileCheck --check-prefix=MSG %s
16 # MSG: removing unused section {{.*}}.o:(.bar)
17 # MSG: removing unused section {{.*}}.o:(.rela.bar)
18 # RUN: llvm-objdump %t --section-headers | FileCheck %s --check-prefix=GC --implicit-check-not=.rela.
19 # GC: .rela.text
20 # GC-NEXT: .debug_info
21 # GC-NEXT: .rela.debug_info
23 .section .bar,"a"
24 .quad .bar
26 .text
27 relocs:
28 .quad _start
30 .global _start
31 _start:
32 nop
34 .section .debug_info,"",@progbits
35 .quad .text