Fix failing test caused by extra precision in register allocated fp values.
authorerik.corry@gmail.com <erik.corry@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 26 Sep 2008 23:14:43 +0000 (23:14 +0000)
committererik.corry@gmail.com <erik.corry@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 26 Sep 2008 23:14:43 +0000 (23:14 +0000)
Review URL: http://codereview.chromium.org/5019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@389 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/checks.h

index 020f1294ea711e92cd4e3b86717971343bacfbbd..13075f89d3b1ba0cf2e6f40556eccb0f58beddbd 100644 (file)
@@ -164,11 +164,18 @@ static inline void CheckEqualsHelper(const char* file,
                                      double expected,
                                      const char* value_source,
                                      double value) {
-  if (expected != value) {
+  // Force values to 64 bit memory to truncate 80 bit precision on IA32.
+  volatile double* exp = new double[1];
+  *exp = expected;
+  volatile double* val = new double[1];
+  *val = value;
+  if (*exp != *val) {
     V8_Fatal(file, line,
              "CHECK_EQ(%s, %s) failed\n#   Expected: %f\n#   Found: %f",
-             expected_source, value_source, expected, value);
+             expected_source, value_source, *exp, *val);
   }
+  delete[] exp;
+  delete[] val;
 }