2016-05-27 20:27:32 +08:00
|
|
|
// Check zlib-gnu style
|
|
|
|
// RUN: llvm-mc -filetype=obj -compress-debug-sections=zlib-gnu -triple x86_64-pc-linux-gnu < %s -o %t
|
|
|
|
// RUN: llvm-objdump -s %t | FileCheck --check-prefix=CHECK-GNU-STYLE %s
|
2017-09-12 06:59:45 +08:00
|
|
|
// RUN: llvm-dwarfdump -debug-str %t | FileCheck --check-prefix=STR %s
|
2016-05-27 20:27:32 +08:00
|
|
|
// RUN: llvm-mc -filetype=obj -compress-debug-sections=zlib-gnu -triple i386-pc-linux-gnu < %s \
|
|
|
|
// RUN: | llvm-readobj -symbols - | FileCheck --check-prefix=386-SYMBOLS-GNU %s
|
|
|
|
|
|
|
|
// Check zlib style
|
|
|
|
// RUN: llvm-mc -filetype=obj -compress-debug-sections=zlib -triple x86_64-pc-linux-gnu < %s -o %t
|
|
|
|
// RUN: llvm-objdump -s %t | FileCheck --check-prefix=CHECK-ZLIB-STYLE %s
|
2017-09-12 06:59:45 +08:00
|
|
|
// RUN: llvm-dwarfdump -debug-str %t | FileCheck --check-prefix=STR %s
|
2016-05-27 20:27:32 +08:00
|
|
|
// RUN: llvm-mc -filetype=obj -compress-debug-sections=zlib -triple i386-pc-linux-gnu < %s \
|
|
|
|
// RUN: | llvm-readobj -symbols - | FileCheck --check-prefix=386-SYMBOLS-ZLIB %s
|
|
|
|
// RUN: llvm-readobj -sections %t | FileCheck --check-prefix=ZLIB-STYLE-FLAGS %s
|
2014-04-11 05:53:47 +08:00
|
|
|
|
2014-03-29 01:04:53 +08:00
|
|
|
// REQUIRES: zlib
|
|
|
|
|
2014-04-19 05:52:26 +08:00
|
|
|
// Don't compress small sections, such as this simple debug_abbrev example
|
2016-05-27 20:27:32 +08:00
|
|
|
// CHECK-GNU-STYLE: Contents of section .debug_abbrev:
|
|
|
|
// CHECK-GNU-STYLE-NOT: ZLIB
|
|
|
|
// CHECK-GNU-STYLE-NOT: Contents of
|
2014-04-19 05:52:26 +08:00
|
|
|
|
2016-05-27 20:27:32 +08:00
|
|
|
// CHECK-GNU-STYLE: Contents of section .debug_info:
|
2014-03-29 05:48:31 +08:00
|
|
|
|
2016-05-27 20:27:32 +08:00
|
|
|
// CHECK-GNU-STYLE: Contents of section .zdebug_str:
|
2016-05-25 08:14:12 +08:00
|
|
|
// Check for the 'ZLIB' file magic at the start of the section only
|
2016-05-27 20:27:32 +08:00
|
|
|
// CHECK-GNU-STYLE-NEXT: ZLIB
|
|
|
|
// CHECK-GNU-STYLE-NOT: ZLIB
|
2014-04-11 05:53:53 +08:00
|
|
|
// FIXME: Handle compressing alignment fragments to support compressing debug_frame
|
2016-05-27 20:27:32 +08:00
|
|
|
// CHECK-GNU-STYLE: Contents of section .debug_frame:
|
|
|
|
// CHECK-GNU-STYLE-NOT: ZLIB
|
|
|
|
// CHECK-GNU-STYLE: Contents of
|
2014-04-11 05:53:53 +08:00
|
|
|
|
2016-05-24 21:45:29 +08:00
|
|
|
// Decompress one valid dwarf section just to check that this roundtrips,
|
|
|
|
// we use .zdebug_str section for that
|
|
|
|
// STR: perfectly compressable data sample *****************************************
|
2014-03-28 04:45:58 +08:00
|
|
|
|
2014-04-19 05:24:12 +08:00
|
|
|
// In x86 32 bit named symbols are used for temporary symbols in merge
|
|
|
|
// sections, so make sure we handle symbols inside compressed sections
|
2016-05-27 20:27:32 +08:00
|
|
|
// 386-SYMBOLS-GNU: Name: .Linfo_string0
|
|
|
|
// 386-SYMBOLS-GNU-NOT: }
|
|
|
|
// 386-SYMBOLS-GNU: Section: .zdebug_str
|
|
|
|
|
|
|
|
// Now check the zlib style output:
|
|
|
|
|
|
|
|
// Don't compress small sections, such as this simple debug_abbrev example
|
|
|
|
// CHECK-ZLIB-STYLE: Contents of section .debug_abbrev:
|
|
|
|
// CHECK-ZLIB-STYLE-NOT: ZLIB
|
|
|
|
// CHECK-ZLIB-STYLE-NOT: Contents of
|
|
|
|
// CHECK-ZLIB-STYLE: Contents of section .debug_info:
|
|
|
|
// FIXME: Handle compressing alignment fragments to support compressing debug_frame
|
|
|
|
// CHECK-ZLIB-STYLE: Contents of section .debug_frame:
|
|
|
|
// CHECK-ZLIB-STYLE-NOT: ZLIB
|
|
|
|
// CHECK-ZLIB-STYLE: Contents of
|
|
|
|
|
|
|
|
// Check that debug_line section was not renamed, so it is
|
|
|
|
// zlib-style, not zlib-gnu one. Check that SHF_COMPRESSED was set.
|
|
|
|
// ZLIB-STYLE-FLAGS: Section {
|
|
|
|
// ZLIB-STYLE-FLAGS: Index:
|
|
|
|
// ZLIB-STYLE-FLAGS: Name: .debug_str
|
|
|
|
// ZLIB-STYLE-FLAGS-NEXT: Type: SHT_PROGBITS
|
|
|
|
// ZLIB-STYLE-FLAGS-NEXT: Flags [
|
|
|
|
// ZLIB-STYLE-FLAGS-NEXT: SHF_COMPRESSED
|
|
|
|
|
|
|
|
// 386-SYMBOLS-ZLIB: Name: .Linfo_string0
|
|
|
|
// 386-SYMBOLS-ZLIB-NOT: }
|
|
|
|
// 386-SYMBOLS-ZLIB: Section: .debug_str
|
2014-04-19 05:24:12 +08:00
|
|
|
|
2014-03-28 04:45:58 +08:00
|
|
|
.section .debug_line,"",@progbits
|
2014-03-29 05:48:31 +08:00
|
|
|
|
|
|
|
.section .debug_abbrev,"",@progbits
|
2014-04-19 05:24:12 +08:00
|
|
|
.Lsection_abbrev:
|
2014-03-29 05:48:31 +08:00
|
|
|
.byte 1 # Abbreviation Code
|
2014-04-11 05:53:53 +08:00
|
|
|
.byte 17 # DW_TAG_compile_unit
|
|
|
|
.byte 0 # DW_CHILDREN_no
|
2014-04-19 05:24:12 +08:00
|
|
|
.byte 27 # DW_AT_comp_dir
|
|
|
|
.byte 14 # DW_FORM_strp
|
2014-04-11 05:53:53 +08:00
|
|
|
.byte 0 # EOM(1)
|
|
|
|
.byte 0 # EOM(2)
|
2014-04-19 05:52:26 +08:00
|
|
|
|
|
|
|
.section .debug_info,"",@progbits
|
|
|
|
.long 12 # Length of Unit
|
|
|
|
.short 4 # DWARF version number
|
|
|
|
.long .Lsection_abbrev # Offset Into Abbrev. Section
|
|
|
|
.byte 8 # Address Size (in bytes)
|
|
|
|
.byte 1 # Abbrev [1] DW_TAG_compile_unit
|
|
|
|
.long .Linfo_string0 # DW_AT_comp_dir
|
|
|
|
|
2014-03-28 04:45:58 +08:00
|
|
|
.text
|
|
|
|
foo:
|
|
|
|
.cfi_startproc
|
|
|
|
.file 1 "Driver.ii"
|
2014-04-19 05:52:26 +08:00
|
|
|
# pad out the line table to make sure it's big enough to warrant compression
|
2014-03-28 04:45:58 +08:00
|
|
|
.loc 1 2 0
|
|
|
|
nop
|
2014-04-19 05:52:26 +08:00
|
|
|
.loc 1 3 0
|
|
|
|
nop
|
|
|
|
.loc 1 4 0
|
|
|
|
nop
|
|
|
|
.loc 1 5 0
|
|
|
|
nop
|
|
|
|
.loc 1 6 0
|
|
|
|
nop
|
|
|
|
.loc 1 7 0
|
|
|
|
nop
|
|
|
|
.loc 1 8 0
|
|
|
|
nop
|
2014-03-28 04:45:58 +08:00
|
|
|
.cfi_endproc
|
|
|
|
.cfi_sections .debug_frame
|
2014-04-19 05:24:12 +08:00
|
|
|
|
2016-05-24 21:45:29 +08:00
|
|
|
# Below is the section we will use to check that after compression with llvm-mc,
|
|
|
|
# llvm-dwarfdump tool will be able to decompress data back and dump it. Data sample
|
|
|
|
# should be compressable enough, so it is filled with some amount of equal symbols at the end
|
2014-04-19 05:24:12 +08:00
|
|
|
.section .debug_str,"MS",@progbits,1
|
|
|
|
.Linfo_string0:
|
2016-05-24 21:45:29 +08:00
|
|
|
.asciz "perfectly compressable data sample *****************************************"
|