3 # RUN: yaml2obj %s -o %t.o
5 # RUN: ld.lld %t.o -o %t.default --compress-debug-sections=zlib
6 # RUN: llvm-readelf --sections %t.default | FileCheck -check-prefixes=HEADER,LEVEL1 %s
8 # RUN: ld.lld -O0 %t.o -o %t.O0 --compress-debug-sections=zlib
9 # RUN: llvm-readelf --sections %t.O0 | FileCheck -check-prefixes=HEADER,LEVEL1 %s
10 # RUN: cmp %t.default %t.O0
12 # RUN: ld.lld -O1 %t.o -o %t.O1 --compress-debug-sections=zlib
13 # RUN: llvm-readelf --sections %t.O1 | FileCheck -check-prefixes=HEADER,LEVEL1 %s
14 # RUN: cmp %t.default %t.O1
16 # RUN: ld.lld -O2 %t.o -o %t.O2 --compress-debug-sections=zlib
17 # RUN: llvm-readelf --sections %t.O2 | FileCheck -check-prefixes=HEADER,LEVEL6 %s
19 ## LLD uses zlib compression of level 1 when -O0, -O1 and level 6 when -O2.
20 ## Here we check how -O flag affects the size of compressed sections produced.
22 # HEADER: [Nr] Name Type Address Off Size
23 # LEVEL1: [ 1] .debug_info PROGBITS 00000000 000094 00001c
24 # LEVEL6: [ 1] .debug_info PROGBITS 00000000 000094 00001a
26 ## A little arbitrary debug section which has a different size after
27 ## applying compression of level 1 and 6.
38 Content: '010101010101010201010201'