summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/ExecutionDriver.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-11-28 07:04:10 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-11-28 07:04:10 +0000
commitd077fe70e90c4a8c936c3f54ad419a28ff806c05 (patch)
treeb962253b11e4c9b7569e68a08b8253783ec20995 /llvm/tools/bugpoint/ExecutionDriver.cpp
parent21052cd48f65bea280be139ba09677af90818036 (diff)
downloadbcm5719-llvm-d077fe70e90c4a8c936c3f54ad419a28ff806c05.tar.gz
bcm5719-llvm-d077fe70e90c4a8c936c3f54ad419a28ff806c05.zip
Add an -append-exit-code option to bugpoint. This will cause bugpoint to
append "exit <retcode>" to the end of the output file. This is used by the nightly tester to make bugpoint match the output generated by the RunSafely.sh script so it doesn't find false positives. llvm-svn: 31960
Diffstat (limited to 'llvm/tools/bugpoint/ExecutionDriver.cpp')
-rw-r--r--llvm/tools/bugpoint/ExecutionDriver.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/tools/bugpoint/ExecutionDriver.cpp b/llvm/tools/bugpoint/ExecutionDriver.cpp
index 93135efb815..92e77376004 100644
--- a/llvm/tools/bugpoint/ExecutionDriver.cpp
+++ b/llvm/tools/bugpoint/ExecutionDriver.cpp
@@ -56,6 +56,11 @@ namespace {
cl::desc("Assume nonzero exit code is failure (default on)"),
cl::init(true));
+ cl::opt<bool>
+ AppendProgramExitCode("append-exit-code",
+ cl::desc("Append the exit code to the output so it gets diff'd too"),
+ cl::init(false));
+
cl::opt<std::string>
InputFile("input", cl::init("/dev/null"),
cl::desc("Filename to pipe in as stdin (default: /dev/null)"));
@@ -277,6 +282,12 @@ std::string BugDriver::executeProgram(std::string OutputFile,
}
}
+ if (AppendProgramExitCode) {
+ std::ofstream outFile(OutputFile.c_str(), std::ios_base::app);
+ outFile << "exit " << RetVal << '\n';
+ outFile.close();
+ }
+
if (ProgramExitedNonzero != 0)
*ProgramExitedNonzero = (RetVal != 0);
OpenPOWER on IntegriCloud