[PATCH] D65334: [llvm] [FileCheck] Use FILECHECK_DUMP_INPUT_ON_FAILURE only when non-empty

Michał Górny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 26 07:05:55 PDT 2019


mgorny created this revision.
mgorny added reviewers: george.karpenkov, jdenny, probinson, krytarowski, lattner.
Herald added a subscriber: thopre.
Herald added a project: LLVM.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D65334

Files:
  llvm/utils/FileCheck/FileCheck.cpp


Index: llvm/utils/FileCheck/FileCheck.cpp
===================================================================
--- llvm/utils/FileCheck/FileCheck.cpp
+++ llvm/utils/FileCheck/FileCheck.cpp
@@ -93,7 +93,8 @@
 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"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65334.211934.patch
Type: text/x-patch
Size: 683 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190726/b88b4c1f/attachment.bin>


More information about the llvm-commits mailing list