[PATCH] D64290: [tools] [llvm-nm] Default to reading from stdin not a.out

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 9 04:49:46 PDT 2019


jhenderson added inline comments.


================
Comment at: llvm/test/tools/llvm-nm/stdin.test:6
+
+## Use passing an explicit filename as the baseline output. llvm-nm should
+## have the same behavior when opening a file itself and reading from its
----------------
Perhaps this first sentence could be rephrased slightly:

"Pass an explicit filename to produce a baseline output."


================
Comment at: llvm/test/tools/llvm-nm/stdin.test:7
+## Use passing an explicit filename as the baseline output. llvm-nm should
+## have the same behavior when opening a file itself and reading from its
+## standard input stream.
----------------
and reading from -> "and reading that file from"


================
Comment at: llvm/test/tools/llvm-nm/stdin.test:12
+## Make sure there is no warning message about no file redirected to stdin.
+# RUN: not grep "warning: can't read from keyboard input." %t.base
+
----------------
This isn't what you want:

a) grep is deprecated in lit tests. Use FileCheck CHECK-NOT/--implicit-check-not.
b) warnings should be printed to stderr, not stdout, so you're searching the wrong place.

You want something like:

```
# RUN: llvm-nm %t.o > %t.base 2> %t.err
# RUN: FileCheck %s --input-file=%t.err --allow-empty --implicit-check-not={{.}}
```

You'll want to add the same check to each of the different test cases.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64290/new/

https://reviews.llvm.org/D64290





More information about the llvm-commits mailing list