diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-11-28 07:04:10 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-11-28 07:04:10 +0000 |
commit | 5e1452c856a8bcf39ab7a67a5af946c8162f942d (patch) | |
tree | 18cccf2643831d79dfcd62098b95af7895a56622 /tools/bugpoint/ExecutionDriver.cpp | |
parent | 2c2148bc270f96e79bc7230e287409658452a9f5 (diff) | |
download | llvm-5e1452c856a8bcf39ab7a67a5af946c8162f942d.tar.gz llvm-5e1452c856a8bcf39ab7a67a5af946c8162f942d.tar.bz2 llvm-5e1452c856a8bcf39ab7a67a5af946c8162f942d.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31960 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/ExecutionDriver.cpp')
-rw-r--r-- | tools/bugpoint/ExecutionDriver.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/bugpoint/ExecutionDriver.cpp b/tools/bugpoint/ExecutionDriver.cpp index 93135efb81..92e7737600 100644 --- a/tools/bugpoint/ExecutionDriver.cpp +++ b/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); |