an annoyance of mine when working on tests: if the input .ll file
is broken, opt outputs an error and generates an empty file. FileCheck
then emits its "ooh I couldn't find the first CHECK line, scanning
from ..." which obfuscates the actual problem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125193
91177308-0d34-0410-b5e6-
96231b3b80d8
}
MemoryBuffer *F = File.take();
+ if (F->getBufferSize() == 0) {
+ errs() << "FileCheck error: '" << InputFilename << "' is empty.\n";
+ return 1;
+ }
+
// Remove duplicate spaces in the input file if requested.
if (!NoCanonicalizeWhiteSpace)
F = CanonicalizeInputFile(F);