39 lines · plain
1# REQUIRES: x86, zlib2 3# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \4# RUN: %S/Inputs/compress-debug-sections.s -o %t1.o5# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t2.o6 7## .debug_str section is mergeable. LLD would combine all of them into single8## mergeable synthetic section. We use -O0 here to disable merging, that9## allows to check that input sections has correctly assigned offsets.10 11# RUN: echo "SECTIONS { }" > %t.script12# RUN: ld.lld -O0 %t1.o %t2.o %t.script -o %t1 --compress-debug-sections=zlib13# RUN: llvm-dwarfdump -a %t1 | FileCheck %s14# RUN: llvm-readobj -S %t1 | FileCheck %s --check-prefix=ZLIBFLAGS15 16# RUN: echo "SECTIONS { .debug_str 0 : { *(.debug_str) } }" > %t2.script17# RUN: ld.lld -O0 %t1.o %t2.o %t2.script -o %t2 --compress-debug-sections=zlib18# RUN: llvm-dwarfdump -a %t2 | FileCheck %s19# RUN: llvm-readobj -S %t2 | FileCheck %s --check-prefix=ZLIBFLAGS20 21# CHECK: .debug_str contents:22# CHECK-NEXT: CCC23# CHECK-NEXT: DDD24# CHECK-NEXT: AAA25# CHECK-NEXT: BBB26 27# ZLIBFLAGS: Section {28# ZLIBFLAGS: Index:29# ZLIBFLAGS: Name: .debug_str30# ZLIBFLAGS-NEXT: Type: SHT_PROGBITS31# ZLIBFLAGS-NEXT: Flags [32# ZLIBFLAGS-NEXT: SHF_COMPRESSED33 34.section .debug_str,"MS",@progbits,135 .asciz "AAA"36 .asciz "BBB"37 .fill 64,1,0x4138 .byte 039