diff options
Diffstat (limited to 'tools/bugpoint/ToolRunner.cpp')
| -rw-r--r-- | tools/bugpoint/ToolRunner.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp index 6c46ef18eb6b..0d98262b4310 100644 --- a/tools/bugpoint/ToolRunner.cpp +++ b/tools/bugpoint/ToolRunner.cpp @@ -854,9 +854,18 @@ int GCC::ExecuteProgram(const std::string &ProgramFile, if (RemoteClientPath.isEmpty()) { DEBUG(errs() << "<run locally>"); - return RunProgramWithTimeout(OutputBinary, &ProgramArgs[0], + int ExitCode = RunProgramWithTimeout(OutputBinary, &ProgramArgs[0], sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile), Timeout, MemoryLimit, Error); + // Treat a signal (usually SIGSEGV) or timeout as part of the program output + // so that crash-causing miscompilation is handled seamlessly. + if (ExitCode < -1) { + std::ofstream outFile(OutputFile.c_str(), std::ios_base::app); + outFile << *Error << '\n'; + outFile.close(); + Error->clear(); + } + return ExitCode; } else { outs() << "<run remotely>"; outs().flush(); return RunProgramRemotelyWithTimeout(sys::Path(RemoteClientPath), |
