[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 05:36:54 PDT 2023


jhenderson added inline comments.


================
Comment at: llvm/test/tools/llvm-symbolizer/pdb/missing_pdb.test:3
+RUN:    | count 0
+RUN: FileCheck -DMSG=%errc_ENOENT %s < %t.err
 
----------------
As @MaskRay suggested, please use --input-file rather than stdin redirection: it is easier to manually run this command using the suggested syntax.


================
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: ??
----------------
sepavloff wrote:
> jhenderson wrote:
> > 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.)
> `--implicit-check-not` does not work, because input is empty and `FileCheck` complains, so used the method proposed by @MaskRay .
You misunderstand me. I meant adding `--implicit-check-not` in the FileCheck line that checked the combined stderr and stdout (which of necessity wouldn't be empty). However, I don't think it's necessary given you've adopted @MaskRay's suggestion.


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