diff options
| author | Xinliang David Li <davidxl@google.com> | 2016-05-27 21:23:25 +0000 |
|---|---|---|
| committer | Xinliang David Li <davidxl@google.com> | 2016-05-27 21:23:25 +0000 |
| commit | 2bd4f8b66bbb0fb43d4dea624008a716478809be (patch) | |
| tree | e9bd8c686a01e5b847f7466bc07eec6f759f4946 | |
| parent | 1508f591b300128a260dfdd0cc87bab52f88c8b5 (diff) | |
| download | bcm5719-llvm-2bd4f8b66bbb0fb43d4dea624008a716478809be.tar.gz bcm5719-llvm-2bd4f8b66bbb0fb43d4dea624008a716478809be.zip | |
FileCheck: dump command line context with empty input
Differential Revision: http://reviews.llvm.org/D20716
llvm-svn: 271047
| -rw-r--r-- | llvm/test/FileCheck/check-empty.txt | 1 | ||||
| -rw-r--r-- | llvm/utils/FileCheck/FileCheck.cpp | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/FileCheck/check-empty.txt b/llvm/test/FileCheck/check-empty.txt index 9caea65ee61..284ad976a54 100644 --- a/llvm/test/FileCheck/check-empty.txt +++ b/llvm/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 diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp index 69f93020317..08055cae96a 100644 --- a/llvm/utils/FileCheck/FileCheck.cpp +++ b/llvm/utils/FileCheck/FileCheck.cpp @@ -1298,6 +1298,13 @@ static void AddCheckPrefixIfNeeded() { 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 @@ int main(int argc, char **argv) { if (File->getBufferSize() == 0 && !AllowEmptyInput) { errs() << "FileCheck error: '" << InputFilename << "' is empty.\n"; + DumpCommandLine(argc, argv); return 2; } |

