Files
clang-p2996/llvm/test/tools/llvm-objcopy/wasm/strip-debug.test
Derek Schuff 7cb25f5387 [llvm-strip][WebAssembly] Support strip flags
Summary:
Add support for the basic section stripping (and keeping) flags for wasm:
strip with no flags, --strip-all, --strip-debug,
--only-section, --keep-section, and --only-keep-debug.

Factor section removal into a function and use a predicate chain like
the ELF implementation.

Reviewers: jhenderson, sbc100

Differential Revision: https://reviews.llvm.org/D73820
2021-07-14 14:17:02 -07:00

54 lines
1.2 KiB
Plaintext

## Test that debug sections (but not linking or names) are stripped with --strip-debug
# RUN: yaml2obj %s -o %t
# RUN: llvm-strip --strip-debug %t
# RUN: obj2yaml %t | FileCheck --implicit-check-not=.debug %s
# CHECK: Sections:
# CHECK-NEXT: - Type: TYPE
# CHECK: Name: linking
# CHECK: Name: name
# CHECK-NEXT: FunctionNames:
# CHECK: Name: producers
--- !WASM
FileHeader:
Version: 0x00000001
Sections:
- Type: TYPE
Signatures:
- Index: 0
ParamTypes: []
ReturnTypes: []
- Type: FUNCTION
FunctionTypes: [ 0 ]
- Type: CODE
Functions:
- Index: 0
Locals: []
Body: 0B
- Type: CUSTOM
Name: .debug_info
Payload: CAFE1234
- Type: CUSTOM
Name: linking
Version: 2
SymbolTable:
- Index: 0
Kind: FUNCTION
Name: foo
Flags: [ BINDING_LOCAL ]
Function: 0
- Type: CUSTOM
Name: name
FunctionNames:
- Index: 0
Name: foo
- Type: CUSTOM
Name: producers
Tools:
- Name: clang
Version: 9.0.0
- Type: CUSTOM
Name: .debug_line
Payload: DEADBEEF