summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/ExecutionDriver.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-23 03:45:26 +0000
committerChris Lattner <sabre@nondot.org>2005-01-23 03:45:26 +0000
commitece10a420e76d7651577a15e83525f65b2df1d5e (patch)
treeaee4db644c511f4fa1484de3e2e545b49d7240d5 /llvm/tools/bugpoint/ExecutionDriver.cpp
parent580f5bfae397dbb1f1765f2f7afe7a1b987977fa (diff)
downloadbcm5719-llvm-ece10a420e76d7651577a15e83525f65b2df1d5e.tar.gz
bcm5719-llvm-ece10a420e76d7651577a15e83525f65b2df1d5e.zip
Add support for fp tolerances
llvm-svn: 19774
Diffstat (limited to 'llvm/tools/bugpoint/ExecutionDriver.cpp')
-rw-r--r--llvm/tools/bugpoint/ExecutionDriver.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/llvm/tools/bugpoint/ExecutionDriver.cpp b/llvm/tools/bugpoint/ExecutionDriver.cpp
index 1dcb69a1c88..966902cec89 100644
--- a/llvm/tools/bugpoint/ExecutionDriver.cpp
+++ b/llvm/tools/bugpoint/ExecutionDriver.cpp
@@ -29,6 +29,13 @@ namespace {
AutoPick, RunLLI, RunJIT, RunLLC, RunCBE
};
+ cl::opt<double>
+ AbsTolerance("abs-tolerance", cl::desc("Absolute error tolerated"),
+ cl::init(0.0));
+ cl::opt<double>
+ RelTolerance("rel-tolerance", cl::desc("Relative error tolerated"),
+ cl::init(0.0));
+
cl::opt<OutputType>
InterpreterSel(cl::desc("Specify how LLVM code should be executed:"),
cl::values(clEnumValN(AutoPick, "auto", "Use best guess"),
@@ -303,9 +310,10 @@ bool BugDriver::diffProgram(const std::string &BytecodeFile,
std::string Error;
bool FilesDifferent = false;
- if (DiffFilesWithTolerance(ReferenceOutputFile, Output.toString(), 0, 0,
- &Error)) {
- if (!Error.empty()) {
+ if (int Diff = DiffFilesWithTolerance(sys::Path(ReferenceOutputFile),
+ sys::Path(Output.toString()),
+ AbsTolerance, RelTolerance, &Error)) {
+ if (Diff == 2) {
std::cerr << "While diffing output: " << Error << '\n';
exit(1);
}
OpenPOWER on IntegriCloud