summaryrefslogtreecommitdiff
path: root/deps/v8/test/cctest/compiler/test-run-machops.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/cctest/compiler/test-run-machops.cc')
-rw-r--r--deps/v8/test/cctest/compiler/test-run-machops.cc24
1 files changed, 23 insertions, 1 deletions
diff --git a/deps/v8/test/cctest/compiler/test-run-machops.cc b/deps/v8/test/cctest/compiler/test-run-machops.cc
index 71adbc738d..419d1b0699 100644
--- a/deps/v8/test/cctest/compiler/test-run-machops.cc
+++ b/deps/v8/test/cctest/compiler/test-run-machops.cc
@@ -4174,7 +4174,6 @@ TEST(RunChangeFloat64ToInt32_B) {
}
}
-
TEST(RunChangeFloat64ToUint32) {
BufferedRawMachineAssemblerTester<uint32_t> m(MachineType::Float64());
m.Return(m.ChangeFloat64ToUint32(m.Parameter(0)));
@@ -6340,6 +6339,29 @@ TEST(RunCallCFunction9) {
#if V8_TARGET_ARCH_64_BIT
// TODO(titzer): run int64 tests on all platforms when supported.
+TEST(RunChangeFloat64ToInt64) {
+ BufferedRawMachineAssemblerTester<int64_t> m(MachineType::Float64());
+ m.Return(m.ChangeFloat64ToInt64(m.Parameter(0)));
+
+ FOR_INT64_INPUTS(i) {
+ double input = static_cast<double>(*i);
+ if (static_cast<int64_t>(input) == *i) {
+ CHECK_EQ(static_cast<int64_t>(input), m.Call(input));
+ }
+ }
+}
+
+TEST(RunChangeInt64ToFloat64) {
+ BufferedRawMachineAssemblerTester<double> m(MachineType::Int64());
+ m.Return(m.ChangeInt64ToFloat64(m.Parameter(0)));
+ FOR_INT64_INPUTS(i) {
+ double output = static_cast<double>(*i);
+ if (static_cast<int64_t>(output) == *i) {
+ CHECK_EQ(output, m.Call(*i));
+ }
+ }
+}
+
TEST(RunBitcastInt64ToFloat64) {
int64_t input = 1;
Float64 output;