diff options
author | Michal Gorny <mgorny@gentoo.org> | 2019-07-26 15:38:57 +0000 |
---|---|---|
committer | Michal Gorny <mgorny@gentoo.org> | 2019-07-26 15:38:57 +0000 |
commit | ffc722a3581775cf6c4bbedf1364434a932dc378 (patch) | |
tree | c9e7cf0b0b1c16a58bb9c5018734d34730366c71 | |
parent | 91e8eac73abdfac922b3f95b462982fccb0c85c5 (diff) | |
download | bcm5719-llvm-ffc722a3581775cf6c4bbedf1364434a932dc378.tar.gz bcm5719-llvm-ffc722a3581775cf6c4bbedf1364434a932dc378.zip |
[llvm] [FileCheck] Use FILECHECK_DUMP_INPUT_ON_FAILURE only when non-empty
Enable dumping output only if FILECHECK_DUMP_INPUT_ON_FAILURE is set to
a non-empty value. This is necessary to support disabling it via
POSIX-compliant env(1) that does not support '-u' argument,
and therefore fix regression caused by r366980.
Differential Revision: https://reviews.llvm.org/D65334
llvm-svn: 367122
-rw-r--r-- | llvm/utils/FileCheck/FileCheck.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp index c882736d4bf..d9cad13c465 100644 --- a/llvm/utils/FileCheck/FileCheck.cpp +++ b/llvm/utils/FileCheck/FileCheck.cpp @@ -93,7 +93,8 @@ static cl::opt<bool> VerboseVerbose( static const char * DumpInputEnv = "FILECHECK_DUMP_INPUT_ON_FAILURE"; static cl::opt<bool> DumpInputOnFailure( - "dump-input-on-failure", cl::init(std::getenv(DumpInputEnv)), + "dump-input-on-failure", + cl::init(std::getenv(DumpInputEnv) && *std::getenv(DumpInputEnv)), cl::desc("Dump original input to stderr before failing.\n" "The value can be also controlled using\n" "FILECHECK_DUMP_INPUT_ON_FAILURE environment variable.\n" |