[PATCH] D153219: [symbolizer] Exit early if input file is absent
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 23 10:21:27 PDT 2023
MaskRay accepted this revision.
MaskRay added a comment.
This revision is now accepted and ready to land.
LGTM.
================
Comment at: llvm/test/tools/llvm-symbolizer/errors.test:1
RUN: not llvm-addr2line -e %p/Inputs/nonexistent 0x12 2>&1 | FileCheck %s --check-prefix=CHECK-NONEXISTENT-A2L -DMSG=%errc_ENOENT
RUN: not llvm-addr2line -e %p/Inputs/nonexistent 2>&1 | FileCheck %s --check-prefix=CHECK-NONEXISTENT-A2L -DMSG=%errc_ENOENT
----------------
Note: I've moved this to `input-file-err.test` as the new name seems more specific about we use this test file.
================
Comment at: llvm/test/tools/llvm-symbolizer/output-style-json-code.test:7
-## Show how library errors are reported in the output.
-# RUN: llvm-symbolizer --output-style=JSON -e %p/no-file.exe 0 | \
-# RUN: FileCheck %s -DMSG=%errc_ENOENT --check-prefix=NO-FILE --strict-whitespace --match-full-lines --implicit-check-not={{.}}
----------------
jhenderson wrote:
> This is possibly a case where we DO want the existing behaviour. The reasoning is that JSON output is intended to be 100% machine-readable.
If we want to keep the test but make it more useful, we can specify two addresses on the command line and see how the error is presented. With the changes, the output is one JSON object with `Error`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153219/new/
https://reviews.llvm.org/D153219
More information about the llvm-commits
mailing list