xref: /llvm-project/llvm/test/tools/llvm-objcopy/ELF/error-format.test (revision 42a21778f61cdc8462ce2cfb6ad7bc1992b2063c)
1## This test shows that we include the tool name in error/warning messages.
2
3# RUN: not llvm-objcopy %S/non-existent 2>&1 | FileCheck --check-prefix=ERR %s -DTOOL=objcopy -DMSG=%errc_ENOENT
4# RUN: not llvm-strip %S/non-existent 2>&1 | FileCheck --check-prefix=ERR %s -DTOOL=strip -DMSG=%errc_ENOENT
5
6# ERR: llvm-[[TOOL]]{{(\.exe)?}}: error: '{{.*}}': [[MSG]]
7
8## Currently llvm-objcopy does not issue warnings, so it is not tested.
9
10# RUN: yaml2obj %s -o %t
11# RUN: llvm-strip %t %t 2>&1 | FileCheck --check-prefix=WARN %s
12
13# WARN: llvm-strip{{(\.exe)?}}: warning: '{{.*}}' was already specified
14
15--- !ELF
16FileHeader:
17  Class:   ELFCLASS64
18  Data:    ELFDATA2LSB
19  Type:    ET_DYN
20  Machine: EM_RISCV
21