-RUN: llvm-size %t.blah 2>&1 | FileCheck --check-prefix=ENOENT %s
+RUN: not llvm-size %t.blah 2>&1 | FileCheck --check-prefix=ENOENT %s
ENOENT: {{.*}}llvm-size{{(\.EXE|\.exe)?}}: error reading file: {{[Nn]}}o such file or directory
static cl::list<std::string>
InputFilenames(cl::Positional, cl::desc("<input files>"), cl::ZeroOrMore);
+bool HadError = false;
+
static std::string ToolName;
/// If ec is not success, print the error and return true.
if (!ec)
return false;
+ HadError = true;
errs() << ToolName << ": error reading file: " << ec.message() << ".\n";
errs().flush();
return true;
std::for_each(InputFilenames.begin(), InputFilenames.end(),
printFileSectionSizes);
- return 0;
+ if (HadError)
+ return 1;
}