Skip to content

Commit 2bd4f8b

Browse files
committed
FileCheck: dump command line context with empty input
Differential Revision: http://reviews.llvm.org/D20716 llvm-svn: 271047
1 parent 1508f59 commit 2bd4f8b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

llvm/test/FileCheck/check-empty.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
; NOFOO-NOT: foo
88

99
; EMPTY-ERR: FileCheck error: '-' is empty.
10+
; EMPTY-ERR-NEXT: FileCheck command line: {{.*}}FileCheck -check-prefix={{.*}}FOO {{.*}}check-empty.txt
1011
; NO-EMPTY-ERR-NOT: FileCheck error: '-' is empty.
1112
; NOT-FOUND: error: expected string not found in input

llvm/utils/FileCheck/FileCheck.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,13 @@ static void AddCheckPrefixIfNeeded() {
12981298
CheckPrefixes.push_back("CHECK");
12991299
}
13001300

1301+
static void DumpCommandLine(int argc, char **argv) {
1302+
errs() << "FileCheck command line: ";
1303+
for (int I = 0; I < argc; I++)
1304+
errs() << " " << argv[I];
1305+
errs() << "\n";
1306+
}
1307+
13011308
int main(int argc, char **argv) {
13021309
sys::PrintStackTraceOnErrorSignal();
13031310
PrettyStackTraceProgram X(argc, argv);
@@ -1331,6 +1338,7 @@ int main(int argc, char **argv) {
13311338

13321339
if (File->getBufferSize() == 0 && !AllowEmptyInput) {
13331340
errs() << "FileCheck error: '" << InputFilename << "' is empty.\n";
1341+
DumpCommandLine(argc, argv);
13341342
return 2;
13351343
}
13361344

0 commit comments

Comments
 (0)