Files
clang-p2996/llvm/test/tools/llvm-objcopy/MachO/add-section-error.test
Alexey Lapshin a6f3fedc3f [objcopy] Refactor CommonConfig to add posibility to specify added/updated sections as MemoryBuffer.
Current objcopy implementation has a possibility to add or update sections.
The incoming section is specified as a pair: section name and name of the file
containing section data. The interface does not allow to specify incoming
section as a memory buffer. This patch adds possibility to specify incoming
section as a memory buffer.

Differential Revision: https://reviews.llvm.org/D120486
2022-03-01 14:49:41 +03:00

15 lines
753 B
Plaintext

## Test --add-section error messages.
# RUN: yaml2obj %p/Inputs/x86_64.yaml -o %t
# RUN: echo -n abcdefg > %t.data
## Error case 1: Nonexistent input file is specified by --add-section.
# RUN: not llvm-objcopy --add-section __TEXT,__text=%t.missing %t %t.nonexistent-file 2>&1 \
# RUN: | FileCheck %s -DINPUT=%t -DSECTION_DATA_FILE=%t.missing -DMSG=%errc_ENOENT --check-prefix=NONEXSITENT-FILE
# NONEXSITENT-FILE: error: '[[SECTION_DATA_FILE]]': [[MSG]]
## Error case 2: Too long segment name.
# RUN: not llvm-objcopy --add-section __TOOOOOOOOO_LONG,__text=%t.data %t %t.too-long-seg-name 2>&1 \
# RUN: | FileCheck %s -DINPUT=%t --check-prefix=TOO-LONG-SEG-NAME
# TOO-LONG-SEG-NAME: error: '[[INPUT]]': too long segment name: '__TOOOOOOOOO_LONG'