[PATCH] D153219: [symbolizer] Exit early if input file is absent

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 01:10:40 PDT 2023


jhenderson added inline comments.


================
Comment at: llvm/test/tools/llvm-symbolizer/output-style-inlined.test:35-42
+RUN: not llvm-symbolizer --output-style=GNU --obj=%p/Inputs/not.exist 0x1 0x2 --no-inlines 2>&1 \
 RUN:   | FileCheck %s --check-prefix=NOT-EXIST-GNU -DMSG=%errc_ENOENT
-RUN: llvm-symbolizer --output-style=LLVM --obj=%p/Inputs/not.exist 0x1 0x2 --no-inlines 2>&1 \
+RUN: not llvm-symbolizer --output-style=LLVM --obj=%p/Inputs/not.exist 0x1 0x2 --no-inlines 2>&1 \
 RUN:   | FileCheck %s --check-prefix=NOT-EXIST-LLVM -DMSG=%errc_ENOENT
 
 # NOT-EXIST-GNU:      llvm-symbolizer{{.*}}: error: '{{.*}}Inputs/not.exist': [[MSG]]
 
----------------
jhenderson wrote:
> 1) In this test, we don't use a comment marker before the CHECK lines
> 2) There's no need for two different check patterns. The output is identical.
Super-nit: delete the extra spacing between NOT-EXIST and llvm-symbolizer as per my previous inline edit.


================
Comment at: llvm/test/tools/llvm-symbolizer/pdb/missing_pdb.test:4
 
 llvm-symbolizer should print one error and two unknown line info records.
 
----------------
This comment looks stale?


================
Comment at: llvm/test/tools/llvm-symbolizer/pdb/missing_pdb.test:7
+CHECK: llvm-symbolizer{{.*}}: error: '{{.*}}missing_pdb.pdb': [[MSG]]
+CHECK-NOT: error reading file
+CHECK-NOT: ??
----------------
Rather than checking that some arbitrary error message is not emitted, better would be to make sure nothing is printed beyond what you expect, with `--implicit-check-not={{.}}`.

(This would have the added benefit of not needing the `count 0` call, if you wanted, although I think @MaskRay's suggestion is cleaner for checking that stdout is empty.)


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