mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-09 09:32:20 +00:00
[cc1as] Support --compress-debug-sections=zstd
`clang -gz=zstd -c a.s` generates ELFCOMPRESS_ZSTD compressed debug info sections if compression decreases size.
This commit is contained in:
parent
3757ef2e66
commit
1f6a86b309
@ -3,4 +3,13 @@
|
||||
|
||||
// RUN: %clang -cc1as -triple i686 --compress-debug-sections %s -o /dev/null
|
||||
// RUN: %clang -cc1as -triple i686 -compress-debug-sections=zlib %s -o /dev/null
|
||||
// RUN: %if zstd %{ %clang -cc1as -triple x86_64 -compress-debug-sections=zstd %s -o /dev/null %}
|
||||
|
||||
// RUN: %if zstd %{ %clang -cc1as -triple x86_64 -filetype obj -compress-debug-sections=zstd %s -o %t %}
|
||||
// RUN: %if zstd %{ llvm-readelf -S -x .debug_str %t | FileCheck %s --check-prefix=ZSTD %}
|
||||
|
||||
// ZSTD: .debug_str PROGBITS [[#%x,]] [[#%x,]] [[#%x,]] 01 MSC 0 0 8
|
||||
// ZSTD: Hex dump of section '.debug_str':
|
||||
// ZSTD: 0000 02000000 00000000
|
||||
|
||||
.section .debug_str,"MS",@progbits,1
|
||||
.asciz "perfectly compressable data sample *****************************************"
|
||||
|
@ -240,6 +240,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
|
||||
llvm::StringSwitch<llvm::DebugCompressionType>(A->getValue())
|
||||
.Case("none", llvm::DebugCompressionType::None)
|
||||
.Case("zlib", llvm::DebugCompressionType::Zlib)
|
||||
.Case("zstd", llvm::DebugCompressionType::Zstd)
|
||||
.Default(llvm::DebugCompressionType::None);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user