[PATCH] D66476: [llvm-objcopy][test] Add a test to show that argv[0] is included in error/warning messages
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 20 08:05:45 PDT 2019
MaskRay updated this revision to Diff 216151.
MaskRay added a comment.
+ `## Currently llvm-objcopy does not issue warnings, so it is not tested.`
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66476/new/
https://reviews.llvm.org/D66476
Files:
test/tools/llvm-objcopy/ELF/error-format.test
Index: test/tools/llvm-objcopy/ELF/error-format.test
===================================================================
--- /dev/null
+++ test/tools/llvm-objcopy/ELF/error-format.test
@@ -0,0 +1,20 @@
+## This test shows that we include the tool name in error/warning messages.
+
+# RUN: not llvm-objcopy %S/non-existent 2>&1 | FileCheck --check-prefix=ERR %s -DTOOL=objcopy
+# RUN: not llvm-strip %S/non-existent 2>&1 | FileCheck --check-prefix=ERR %s -DTOOL=strip
+
+# ERR: llvm-[[TOOL]]{{(\.exe)?}}: error: '{{.*}}': {{[Nn]}}o such file or directory
+
+## Currently llvm-objcopy does not issue warnings, so it is not tested.
+
+# RUN: yaml2obj %s -o %t
+# RUN: llvm-strip %t %t 2>&1 | FileCheck --check-prefix=WARN %s
+
+# WARN: llvm-strip{{(\.exe)?}}: warning: '{{.*}}' was already specified
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_DYN
+ Machine: EM_RISCV
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66476.216151.patch
Type: text/x-patch
Size: 909 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190820/d498f329/attachment.bin>
More information about the llvm-commits
mailing list