Index: test/cctest/compiler/test-run-machops.cc |
diff --git a/test/cctest/compiler/test-run-machops.cc b/test/cctest/compiler/test-run-machops.cc |
index 08f8f3f4c31da4fb474c7dc3fb056af7c0cfaa53..c6ed018a3a8705e17f92f3b501b6322fc5a1de66 100644 |
--- a/test/cctest/compiler/test-run-machops.cc |
+++ b/test/cctest/compiler/test-run-machops.cc |
@@ -5346,18 +5346,20 @@ TEST(RunBitcastInt64ToFloat64) { |
TEST(RunBitcastFloat64ToInt64) { |
- double input = 0; |
- int64_t output = 0; |
- RawMachineAssemblerTester<int32_t> m; |
- m.StoreToPointer( |
- &output, kMachInt64, |
- m.BitcastFloat64ToInt64(m.LoadFromPointer(&input, kMachFloat64))); |
- m.Return(m.Int32Constant(11)); |
- FOR_FLOAT64_INPUTS(i) { |
- input = *i; |
- CHECK_EQ(11, m.Call()); |
- double expected = bit_cast<int64_t>(input); |
- CHECK_EQ(expected, output); |
+ BufferedRawMachineAssemblerTester<int64_t> m(kMachFloat64); |
+ |
+ m.Return(m.BitcastFloat64ToInt64(m.Parameter(0))); |
+ FOR_FLOAT64_INPUTS(i) { CHECK_EQ(bit_cast<int64_t>(*i), m.Call(*i)); } |
+} |
+ |
+ |
+TEST(RunChangeFloat64ToInt64) { |
+ BufferedRawMachineAssemblerTester<int64_t> m(kMachFloat64); |
+ m.Return(m.ChangeFloat64ToInt64(m.Parameter(0))); |
+ |
+ FOR_INT64_INPUTS(i) { |
+ double input = static_cast<double>(*i); |
+ CHECK_EQ(static_cast<int64_t>(input), m.Call(input)); |
} |
} |