1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/test/tools/llvm-objcopy/ELF/strip-unneeded-remove-debug-keep-link.test
Fangrui Song d68dfedd72 [test] Use yaml2obj -o %t instead of > %t
To improve consistency and avoid unneeded shell feature (output
redirection).

While here, make other changes to improve consistency

--docnum 1 => --docnum=1
-docnum=x => --docnum=x
2020-01-21 17:20:18 -08:00

30 lines
836 B
Plaintext

## Verifies that running with --strip-unneeded removes debugging sections but
## retains the .gnu_debuglink section.
# RUN: yaml2obj %s -o %t.o
# RUN: touch %t.debug
# RUN: llvm-objcopy --add-gnu-debuglink=%t.debug %t.o %t.2.o
# RUN: llvm-strip --strip-unneeded %t.2.o -o %t.3.o
# RUN: llvm-readelf --sections %t.3.o | FileCheck %s
!ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
- Name: .debugfoo
Type: SHT_PROGBITS
# CHECK: There are 5 section headers
# CHECK: [ 0]
# CHECK-NEXT: [ 1] .text
# CHECK-NEXT: [ 2] .strtab
# CHECK-NEXT: [ 3] .shstrtab
# CHECK-NEXT: [ 4] .gnu_debuglink