Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1710)

Unified Diff: test/cctest/wasm/test-run-wasm-64.cc

Issue 1928513002: Implement UnalignedLoad and UnalignedStore in WASM using LoadByte/Shift/Or and StoreByte/Shift/And. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix nits. Fix compilation error on Windows compiler Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/wasm/test-run-wasm.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/test-run-wasm-64.cc
diff --git a/test/cctest/wasm/test-run-wasm-64.cc b/test/cctest/wasm/test-run-wasm-64.cc
index 333183a842cdfe5a3ce5980459c3f35e20a3d7f9..578698783177a9e1de40ac724cdc3a2e844fc3cd 100644
--- a/test/cctest/wasm/test-run-wasm-64.cc
+++ b/test/cctest/wasm/test-run-wasm-64.cc
@@ -1247,7 +1247,29 @@ WASM_EXEC_TEST(LoadMemI64) {
CHECK_EQ(77777777, r.Call());
}
-WASM_EXEC_TEST(MemI64_Sum) {
+WASM_EXEC_TEST(Run_Wasm_LoadMemI64_alignment) {
+ REQUIRE(I64LoadStore);
+ TestingModule module;
+ int64_t* memory = module.AddMemoryElems<int64_t>(8);
+ for (byte alignment = 0; alignment <= 3; alignment++) {
+ module.RandomizeMemory(1111);
+ WasmRunner<int64_t> r(&module);
+
+ BUILD(r,
+ WASM_LOAD_MEM_ALIGNMENT(MachineType::Int64(), WASM_I8(0), alignment));
+
+ memory[0] = 0xaabbccdd00112233LL;
+ CHECK_EQ(0xaabbccdd00112233LL, r.Call());
+
+ memory[0] = 0x33aabbccdd001122LL;
+ CHECK_EQ(0x33aabbccdd001122LL, r.Call());
+
+ memory[0] = 77777777;
+ CHECK_EQ(77777777, r.Call());
+ }
+}
+
+WASM_EXEC_TEST(Run_Wasm_MemI64_Sum) {
REQUIRE(I64LoadStore);
REQUIRE(I64Add);
REQUIRE(I64Sub);
@@ -1283,7 +1305,24 @@ WASM_EXEC_TEST(MemI64_Sum) {
}
}
-WASM_EXEC_TEST(I64Global) {
+WASM_EXEC_TEST(Run_Wasm_StoreMemI64_alignment) {
+ TestingModule module;
+ int64_t* memory = module.AddMemoryElems<int64_t>(4);
+ const int64_t kWritten = 0x12345678abcd0011ll;
+
+ for (byte i = 0; i <= 3; i++) {
+ WasmRunner<int64_t> r(&module, MachineType::Int64());
+ BUILD(r, WASM_STORE_MEM_ALIGNMENT(MachineType::Int64(), WASM_ZERO, i,
+ WASM_GET_LOCAL(0)));
+ module.RandomizeMemory(1111);
+ memory[0] = 0;
+
+ CHECK_EQ(kWritten, r.Call(kWritten));
+ CHECK_EQ(kWritten, memory[0]);
+ }
+}
+
+WASM_EXEC_TEST(Run_Wasm_I64Global) {
REQUIRE(I64LoadStore);
REQUIRE(I64SConvertI32);
REQUIRE(I64And);
« no previous file with comments | « test/cctest/wasm/test-run-wasm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698