aboutsummaryrefslogtreecommitdiff
path: root/utils/fpcmp/fpcmp.cpp
diff options
context:
space:
mode:
authorJohn Criswell <criswell@uiuc.edu>2005-11-02 18:05:50 +0000
committerJohn Criswell <criswell@uiuc.edu>2005-11-02 18:05:50 +0000
commitcfa435f79bf39fead32263a8b71c9ae440b55214 (patch)
tree2f1ef0a4c3fb5549b8bbb014891f92866d46e042 /utils/fpcmp/fpcmp.cpp
Mark these as failing on sparc instead of sparcv9.
The configure script no longer tells us that we're configuring for SparcV9 specifically. 2004-06-17-UnorderedCompares may work on SparcV8, but it's experiental anyway. 2005-02-20-AggregateSAVEEXPR should fail on any Solaris machine, as Solaris doesn't provide complex number support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_16@24155 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/fpcmp/fpcmp.cpp')
-rw-r--r--utils/fpcmp/fpcmp.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/utils/fpcmp/fpcmp.cpp b/utils/fpcmp/fpcmp.cpp
new file mode 100644
index 0000000000..913fde50e5
--- /dev/null
+++ b/utils/fpcmp/fpcmp.cpp
@@ -0,0 +1,42 @@
+//===- fpcmp.cpp - A fuzzy "cmp" that permits floating point noise --------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// fpcmp is a tool that basically works like the 'cmp' tool, except that it can
+// tolerate errors due to floating point noise, with the -r and -a options.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/FileUtilities.h"
+#include <iostream>
+using namespace llvm;
+
+namespace {
+ cl::opt<std::string>
+ File1(cl::Positional, cl::desc("<input file #1>"), cl::Required);
+ cl::opt<std::string>
+ File2(cl::Positional, cl::desc("<input file #2>"), cl::Required);
+
+ cl::opt<double>
+ RelTolerance("r", cl::desc("Relative error tolerated"), cl::init(0));
+ cl::opt<double>
+ AbsTolerance("a", cl::desc("Absolute error tolerated"), cl::init(0));
+}
+
+int main(int argc, char **argv) {
+ cl::ParseCommandLineOptions(argc, argv);
+
+ std::string ErrorMsg;
+ int DF = DiffFilesWithTolerance(sys::Path(File1), sys::Path(File2),
+ AbsTolerance, RelTolerance, &ErrorMsg);
+ if (!ErrorMsg.empty())
+ std::cerr << argv[0] << ": " << ErrorMsg << "\n";
+ return DF;
+}
+