Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / linkerscript / compress-debug-sections.s
blobfe1c66dbdbdcde69e4ea00b6b49d82b307ba5df3
1 # REQUIRES: x86, zlib
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \
4 # RUN: %S/Inputs/compress-debug-sections.s -o %t1.o
5 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t2.o
7 ## .debug_str section is mergeable. LLD would combine all of them into single
8 ## mergeable synthetic section. We use -O0 here to disable merging, that
9 ## allows to check that input sections has correctly assigned offsets.
11 # RUN: echo "SECTIONS { }" > %t.script
12 # RUN: ld.lld -O0 %t1.o %t2.o %t.script -o %t1 --compress-debug-sections=zlib
13 # RUN: llvm-dwarfdump -a %t1 | FileCheck %s
14 # RUN: llvm-readobj -S %t1 | FileCheck %s --check-prefix=ZLIBFLAGS
16 # RUN: echo "SECTIONS { .debug_str 0 : { *(.debug_str) } }" > %t2.script
17 # RUN: ld.lld -O0 %t1.o %t2.o %t2.script -o %t2 --compress-debug-sections=zlib
18 # RUN: llvm-dwarfdump -a %t2 | FileCheck %s
19 # RUN: llvm-readobj -S %t2 | FileCheck %s --check-prefix=ZLIBFLAGS
21 # CHECK: .debug_str contents:
22 # CHECK-NEXT: CCC
23 # CHECK-NEXT: DDD
24 # CHECK-NEXT: AAA
25 # CHECK-NEXT: BBB
27 # ZLIBFLAGS: Section {
28 # ZLIBFLAGS: Index:
29 # ZLIBFLAGS: Name: .debug_str
30 # ZLIBFLAGS-NEXT: Type: SHT_PROGBITS
31 # ZLIBFLAGS-NEXT: Flags [
32 # ZLIBFLAGS-NEXT: SHF_COMPRESSED
34 .section .debug_str,"MS",@progbits,1
35 .asciz "AAA"
36 .asciz "BBB"