[PATCH] D20716: FileCheck: dump command line context with empty input

David Li via llvm-commits llvm-commits at lists.llvm.org
Fri May 27 14:29:50 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL271047: FileCheck: dump command line context with empty input (authored by davidxl).

Changed prior to commit:
  http://reviews.llvm.org/D20716?vs=58736&id=58839#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D20716

Files:
  llvm/trunk/test/FileCheck/check-empty.txt
  llvm/trunk/utils/FileCheck/FileCheck.cpp

Index: llvm/trunk/test/FileCheck/check-empty.txt
===================================================================
--- llvm/trunk/test/FileCheck/check-empty.txt
+++ llvm/trunk/test/FileCheck/check-empty.txt
@@ -7,5 +7,6 @@
 ; NOFOO-NOT: foo
 
 ; EMPTY-ERR: FileCheck error: '-' is empty.
+; EMPTY-ERR-NEXT: FileCheck command line: {{.*}}FileCheck -check-prefix={{.*}}FOO {{.*}}check-empty.txt
 ; NO-EMPTY-ERR-NOT: FileCheck error: '-' is empty.
 ; NOT-FOUND: error: expected string not found in input
Index: llvm/trunk/utils/FileCheck/FileCheck.cpp
===================================================================
--- llvm/trunk/utils/FileCheck/FileCheck.cpp
+++ llvm/trunk/utils/FileCheck/FileCheck.cpp
@@ -1298,6 +1298,13 @@
     CheckPrefixes.push_back("CHECK");
 }
 
+static void DumpCommandLine(int argc, char **argv) {
+  errs() << "FileCheck command line: ";
+  for (int I = 0; I < argc; I++)
+    errs() << " " << argv[I];
+  errs() << "\n";
+}
+
 int main(int argc, char **argv) {
   sys::PrintStackTraceOnErrorSignal();
   PrettyStackTraceProgram X(argc, argv);
@@ -1331,6 +1338,7 @@
 
   if (File->getBufferSize() == 0 && !AllowEmptyInput) {
     errs() << "FileCheck error: '" << InputFilename << "' is empty.\n";
+    DumpCommandLine(argc, argv);
     return 2;
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20716.58839.patch
Type: text/x-patch
Size: 1287 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160527/306b65e5/attachment.bin>


More information about the llvm-commits mailing list