George Rimar | 2725717 | 2019-03-24 14:41:45 +0000 | [diff] [blame] | 1 | # REQUIRES: zlib |
| 2 | |
| 3 | ## In this test, we check how llvm-objcopy handles compression/decompression |
| 4 | ## of debug sections included in a COMDAT group. |
| 5 | |
| 6 | # RUN: yaml2obj %p/Inputs/compress-debug-sections.yaml -o %t.o |
| 7 | |
| 8 | ## Check compression of debug sections. |
| 9 | # RUN: llvm-objcopy --compress-debug-sections %t.o %t-compressed.o |
Fangrui Song | e29e30b | 2019-05-01 05:27:20 +0000 | [diff] [blame] | 10 | # RUN: llvm-readobj -S --elf-section-groups %t-compressed.o | \ |
George Rimar | 2725717 | 2019-03-24 14:41:45 +0000 | [diff] [blame] | 11 | # RUN: FileCheck %s --check-prefixes=CHECK,COMPRESS |
| 12 | |
| 13 | ## Check zlib-gnu compression of debug sections. |
| 14 | # RUN: llvm-objcopy --compress-debug-sections=zlib-gnu %t.o %t-compressed-gnu.o |
Fangrui Song | e29e30b | 2019-05-01 05:27:20 +0000 | [diff] [blame] | 15 | # RUN: llvm-readobj -S --elf-section-groups %t-compressed-gnu.o | \ |
George Rimar | 2725717 | 2019-03-24 14:41:45 +0000 | [diff] [blame] | 16 | # RUN: FileCheck %s --check-prefixes=CHECK,COMPRESSZLIB |
| 17 | |
| 18 | ## Check decompression of debug sections. |
| 19 | # RUN: llvm-objcopy --decompress-debug-sections %t-compressed.o %t-decompressed.o |
Fangrui Song | e29e30b | 2019-05-01 05:27:20 +0000 | [diff] [blame] | 20 | # RUN: llvm-readobj --elf-section-groups %t-decompressed.o | \ |
George Rimar | 2725717 | 2019-03-24 14:41:45 +0000 | [diff] [blame] | 21 | # RUN: FileCheck %s --check-prefixes=CHECK,DECOMPRESS |
| 22 | |
| 23 | ## Check decompression of zlib-gnu debug sections. |
| 24 | # RUN: llvm-objcopy --decompress-debug-sections %t-compressed-gnu.o %t-decompressed-gnu.o |
Fangrui Song | e29e30b | 2019-05-01 05:27:20 +0000 | [diff] [blame] | 25 | # RUN: llvm-readobj --elf-section-groups %t-decompressed-gnu.o | \ |
George Rimar | 2725717 | 2019-03-24 14:41:45 +0000 | [diff] [blame] | 26 | # RUN: FileCheck %s --check-prefixes=CHECK,DECOMPRESS |
| 27 | |
| 28 | # COMPRESSZLIB: Name: .zdebug_in_group |
| 29 | # COMPRESSZLIB-NEXT: Type: SHT_PROGBITS |
| 30 | # COMPRESSZLIB-NEXT: Flags [ |
| 31 | # COMPRESSZLIB-NEXT: SHF_GROUP |
| 32 | # COMPRESSZLIB-NEXT: ] |
| 33 | |
| 34 | # COMPRESS: Name: .debug_in_group |
| 35 | # COMPRESS-NEXT: Type: SHT_PROGBITS |
| 36 | # COMPRESS-NEXT: Flags [ |
| 37 | # COMPRESS-NEXT: SHF_COMPRESSED |
| 38 | # COMPRESS-NEXT: SHF_GROUP |
| 39 | # COMPRESS-NEXT: ] |
| 40 | |
| 41 | # CHECK: Group { |
| 42 | # CHECK-NEXT: Name: .group |
| 43 | # CHECK-NEXT: Index: |
| 44 | # CHECK-NEXT: Link: |
| 45 | # CHECK-NEXT: Info: |
| 46 | # CHECK-NEXT: Type: COMDAT |
| 47 | # CHECK-NEXT: Signature: groupname |
| 48 | # CHECK-NEXT: Section(s) in group [ |
| 49 | # CHECK-NEXT: .text.in.group |
| 50 | # COMPRESSZLIB-NEXT: .zdebug_in_group |
| 51 | # COMPRESS-NEXT: .debug_in_group |
| 52 | # DECOMPRESS-NEXT: .debug_in_group |
| 53 | # CHECK-NEXT: ] |