[MCJIT] Make llvm-rtdyld check RuntimeDyld's error state when running in -verify

mode.

This will cause -verify mode to report failure when RuntimeDyld encounters an
internal error (e.g. overflows in relocation computations). Previously we had
let these errors slip past unreported.

llvm-svn: 214925
This commit is contained in:
Lang Hames 2014-08-05 20:51:46 +00:00
parent 822434da9f
commit ae17268a7e
1 changed files with 8 additions and 1 deletions

View File

@ -439,7 +439,14 @@ static int linkAndVerify() {
// Resolve all the relocations we can.
Dyld.resolveRelocations();
return checkAllExpressions(Checker);
int ErrorCode = checkAllExpressions(Checker);
if (Dyld.hasError()) {
errs() << "RTDyld reported an error applying relocations:\n "
<< Dyld.getErrorString() << "\n";
ErrorCode = 1;
}
return ErrorCode;
}
int main(int argc, char **argv) {