Files
clang-p2996/llvm/test/tools/llvm-objcopy/regex-error.test
Ilia Kuklin bdcb841aa7 [objcopy] Return an error in case of an invalid regex (#74319)
As of now, llvm-objcopy silently ignores a provided regex if it doesn't
compile.

This patch adds returning an error saying that a regex couldn't be
compiled, along with the compilation error message.

---------

Co-authored-by: James Henderson <46713263+jh7370@users.noreply.github.com>
2023-12-08 01:16:52 +05:00

14 lines
345 B
Plaintext

## Test if providing objcopy with an invalid regex generates an error.
# RUN: yaml2obj %s -o %t
# RUN: not llvm-objcopy --regex --strip-symbol='[^)\' %t /dev/null 2>&1 | FileCheck %s
# CHECK: error: cannot compile regular expression '[^)\'
!ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_X86_64