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
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.
20 # GC-NEXT: .debug_info
21 # GC-NEXT: .rela.debug_info
34 .section .debug_info,"",@progbits