mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
emit a specific error when the input file is empty. This fixes
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
This commit is contained in:
@@ -659,6 +659,11 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
MemoryBuffer *F = File.take();
|
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.
|
// Remove duplicate spaces in the input file if requested.
|
||||||
if (!NoCanonicalizeWhiteSpace)
|
if (!NoCanonicalizeWhiteSpace)
|
||||||
F = CanonicalizeInputFile(F);
|
F = CanonicalizeInputFile(F);
|
||||||
|
Reference in New Issue
Block a user