diff options
author | Stephen Tozer <stephen.tozer@sony.com> | 2019-04-15 11:17:48 +0000 |
---|---|---|
committer | Stephen Tozer <stephen.tozer@sony.com> | 2019-04-15 11:17:48 +0000 |
commit | 19bb1d5739b4d0a4921717609e8615d20097b96e (patch) | |
tree | 9f36b61f8bd02ff12fd50e3efe47a895470a6006 /llvm/test/tools/llvm-readobj/string-dump.test | |
parent | cdf126ebec185d135dfb99cb907cf4f40583e3dc (diff) | |
download | bcm5719-llvm-19bb1d5739b4d0a4921717609e8615d20097b96e.tar.gz bcm5719-llvm-19bb1d5739b4d0a4921717609e8615d20097b96e.zip |
[llvm-readobj] Reapply: Improve error message for --string-dump
This is a resubmission of a previous patch that caused test failures,
with the fixes for the relevant tests included.
Fixes bug 40630: https://bugs.llvm.org/show_bug.cgi?id=40630
This patch changes the error message when the section specified by
--string-dump cannot be found by including the name of the section in
the error message and changing the prefix text to not imply that the
file itself was invalid. As part of this change some uses of
std::error_code have been replaced with the llvm Error class to better
encapsulate the error info (rather than passing File strings around),
and the WithColor class replaces string literal error prefixes.
llvm-svn: 358395
Diffstat (limited to 'llvm/test/tools/llvm-readobj/string-dump.test')
-rw-r--r-- | llvm/test/tools/llvm-readobj/string-dump.test | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/test/tools/llvm-readobj/string-dump.test b/llvm/test/tools/llvm-readobj/string-dump.test index a0ada84650e..321d2470177 100644 --- a/llvm/test/tools/llvm-readobj/string-dump.test +++ b/llvm/test/tools/llvm-readobj/string-dump.test @@ -50,13 +50,14 @@ # CHECK-NEXT: [ 3] null{{$}} # CHECK-NOT: {{.}} -# RUN: not llvm-readobj --string-dump=does_not_exist %t 2>&1 | FileCheck %s --check-prefix=ERR -# RUN: not llvm-readobj --string-dump=42 %t 2>&1 | FileCheck %s --check-prefix=ERR +# RUN: not llvm-readobj --string-dump=does_not_exist %t 2>&1 | FileCheck %s --check-prefix=ERR1 +# RUN: not llvm-readobj --string-dump=42 %t 2>&1 | FileCheck %s --check-prefix=ERR2 -# RUN: not llvm-readelf --string-dump=does_not_exist %t 2>&1 | FileCheck %s --check-prefix=ERR -# RUN: not llvm-readelf --string-dump=42 %t 2>&1 | FileCheck %s --check-prefix=ERR +# RUN: not llvm-readelf --string-dump=does_not_exist %t 2>&1 | FileCheck %s --check-prefix=ERR1 +# RUN: not llvm-readelf --string-dump=42 %t 2>&1 | FileCheck %s --check-prefix=ERR2 -# ERR: Error reading file: invalid section reference. +# ERR1: error: could not find section 'does_not_exist' +# ERR2: error: could not find section '42' --- !ELF FileHeader: |