Index: test/cctest/compiler/codegen-tester.h |
diff --git a/test/cctest/compiler/codegen-tester.h b/test/cctest/compiler/codegen-tester.h |
index d45d1fdc3322fc279185e54b0c2b0be44af15ff7..f2fc48a4799536f1774c2df968f22c1fe5837187 100644 |
--- a/test/cctest/compiler/codegen-tester.h |
+++ b/test/cctest/compiler/codegen-tester.h |
@@ -143,7 +143,7 @@ class BinopTester { |
CHECK_EQ(CHECK_VALUE, T->Call()); |
return result; |
} else { |
- return T->Call(); |
+ return static_cast<CType>(T->Call()); |
} |
} |
@@ -200,6 +200,17 @@ class Uint32BinopTester |
}; |
+// A helper class for testing code sequences that take two float parameters and |
+// return a float value. |
+// TODO(titzer): figure out how to return floats correctly on ia32. |
+class Float32BinopTester |
+ : public BinopTester<float, kMachFloat32, USE_RESULT_BUFFER> { |
+ public: |
+ explicit Float32BinopTester(RawMachineAssemblerTester<int32_t>* tester) |
+ : BinopTester<float, kMachFloat32, USE_RESULT_BUFFER>(tester) {} |
+}; |
+ |
+ |
// A helper class for testing code sequences that take two double parameters and |
// return a double value. |
// TODO(titzer): figure out how to return doubles correctly on ia32. |
@@ -334,6 +345,14 @@ class Int32BinopInputShapeTester { |
}; |
// TODO(bmeurer): Drop this crap once we switch to GTest/Gmock. |
+static inline void CheckFloatEq(volatile float x, volatile float y) { |
+ if (std::isnan(x)) { |
+ CHECK(std::isnan(y)); |
+ } else { |
+ CHECK(x == y); |
+ } |
+} |
+ |
static inline void CheckDoubleEq(volatile double x, volatile double y) { |
if (std::isnan(x)) { |
CHECK(std::isnan(y)); |