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 8b14dab46c4544105c4c581c38c2fa9f5b8b33f6..2206181f19013cb6d288a84dc866a553e1d506f3 100644 |
--- a/test/cctest/compiler/test-run-machops.cc |
+++ b/test/cctest/compiler/test-run-machops.cc |
@@ -5277,5 +5277,49 @@ TEST(RunCallCFunction8) { |
CHECK_EQ(x * 8, m.Call(x)); |
} |
} |
- |
#endif // USE_SIMULATOR |
+ |
+#if V8_TARGET_ARCH_64_BIT |
+TEST(RunCheckedLoadInt64) { |
+ int64_t buffer[] = {0x66bbccddeeff0011LL, 0x1122334455667788LL}; |
+ RawMachineAssemblerTester<int64_t> m(kMachInt32); |
+ Node* base = m.PointerConstant(buffer); |
+ Node* index = m.Parameter(0); |
+ Node* length = m.Int32Constant(16); |
+ Node* load = |
+ m.NewNode(m.machine()->CheckedLoad(kMachInt64), base, index, length); |
+ m.Return(load); |
+ |
+ CHECK_EQ(buffer[0], m.Call(0)); |
+ CHECK_EQ(buffer[1], m.Call(8)); |
+ CHECK_EQ(0, m.Call(16)); |
+} |
+ |
+ |
+TEST(RunCheckedStoreInt64) { |
+ const int64_t write = 0x5566778899aabbLL; |
+ const int64_t before = 0x33bbccddeeff0011LL; |
+ int64_t buffer[] = {before, before}; |
+ RawMachineAssemblerTester<int32_t> m(kMachInt32); |
+ Node* base = m.PointerConstant(buffer); |
+ Node* index = m.Parameter(0); |
+ Node* length = m.Int32Constant(16); |
+ Node* value = m.Int64Constant(write); |
+ Node* store = m.NewNode(m.machine()->CheckedStore(kMachInt64), base, index, |
+ length, value); |
+ USE(store); |
+ m.Return(m.Int32Constant(11)); |
+ |
+ CHECK_EQ(11, m.Call(16)); |
+ CHECK_EQ(before, buffer[0]); |
+ CHECK_EQ(before, buffer[1]); |
+ |
+ CHECK_EQ(11, m.Call(0)); |
+ CHECK_EQ(write, buffer[0]); |
+ CHECK_EQ(before, buffer[1]); |
+ |
+ CHECK_EQ(11, m.Call(8)); |
+ CHECK_EQ(write, buffer[0]); |
+ CHECK_EQ(write, buffer[1]); |
+} |
+#endif |