[LLVMdev] [RFC] Switching make check to use 'set -o pipefail'

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Jul 4 20:56:44 PDT 2013

We currently don't use pipefail when running test under make check.
This has the undesirable property that it is really easy for tests to
bitrot. For example, something like

llc %s | FileCheck %s

will still pass if llc crashes after printing what FileCheck was
looking for. It is also easy to break the tests when refactoring. I
have fixed tests that were doing

%clang_cc1 -a-driver-options ... | not grep

clearly the test was changed from %clang to %clang_cc1 and we missed
the fact that the option also had to be updated.

Currently to check a command output and that it doesn't crash we have to do

llc %s > %t
FileCheck %s < %t

I would like to switch to using pipefail instead. That would meant that a simple

llc %s | FileCheck %s

would check both llc return value and output. I have already cleared
all the tests, so all that is missing is changing lit itself. Any
objections to doing so?


More information about the llvm-dev mailing list