summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-objcopy
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-08-20 15:34:07 +0000
committerFangrui Song <maskray@google.com>2019-08-20 15:34:07 +0000
commit494a4d16809e938cae0b1cd0e0792d49f7fb054c (patch)
tree437fcf954c387c36fd1e1d85e3615c8ed1058815 /llvm/test/tools/llvm-objcopy
parentebd50291e8cf5911eb9c2da54389d93312caadd2 (diff)
downloadbcm5719-llvm-494a4d16809e938cae0b1cd0e0792d49f7fb054c.tar.gz
bcm5719-llvm-494a4d16809e938cae0b1cd0e0792d49f7fb054c.zip
[llvm-objcopy][test] Add a test to show that argv[0] is included in error/warning messages
test/llvm-objcopy/ELF/error-format.test is similar to test/llvm-readobj/error-format.test added in D66425. Reviewed By: grimar, jhenderson Differential Revision: https://reviews.llvm.org/D66476 llvm-svn: 369392
Diffstat (limited to 'llvm/test/tools/llvm-objcopy')
-rw-r--r--llvm/test/tools/llvm-objcopy/ELF/error-format.test20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-objcopy/ELF/error-format.test b/llvm/test/tools/llvm-objcopy/ELF/error-format.test
new file mode 100644
index 00000000000..8a74fb0d134
--- /dev/null
+++ b/llvm/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
OpenPOWER on IntegriCloud