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

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

Issue 2034093002: Implement WASM big-endian support (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Small fixes. Rebase to master Created 4 years, 6 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') | test/cctest/wasm/wasm-run-utils.h » ('j') | 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 af8749864e8e76e102cc48c1d196ce3d628c1835..404960abf044bfab3f8e7f9347843e38e5cee7b1 100644
--- a/test/cctest/wasm/test-run-wasm-64.cc
+++ b/test/cctest/wasm/test-run-wasm-64.cc
@@ -1245,7 +1245,7 @@ WASM_EXEC_TEST(I64ReinterpretF64) {
FOR_INT32_INPUTS(i) {
int64_t expected = static_cast<int64_t>(*i) * 0x300010001;
- memory[0] = expected;
+ module.WriteMemory(&memory[0], expected);
CHECK_EQ(expected, r.Call());
}
}
@@ -1264,7 +1264,7 @@ WASM_EXEC_TEST(F64ReinterpretI64) {
FOR_INT32_INPUTS(i) {
int64_t expected = static_cast<int64_t>(*i) * 0x300010001;
CHECK_EQ(expected, r.Call(expected));
- CHECK_EQ(expected, memory[0]);
+ CHECK_EQ(expected, module.ReadMemory<int64_t>(&memory[0]));
}
}
@@ -1277,13 +1277,13 @@ WASM_EXEC_TEST(LoadMemI64) {
BUILD(r, WASM_LOAD_MEM(MachineType::Int64(), WASM_I8(0)));
- memory[0] = 0xaabbccdd00112233LL;
+ module.WriteMemory<int64_t>(&memory[0], 0xaabbccdd00112233LL);
CHECK_EQ(0xaabbccdd00112233LL, r.Call());
- memory[0] = 0x33aabbccdd001122LL;
+ module.WriteMemory<int64_t>(&memory[0], 0x33aabbccdd001122LL);
CHECK_EQ(0x33aabbccdd001122LL, r.Call());
- memory[0] = 77777777;
+ module.WriteMemory<int64_t>(&memory[0], 77777777);
CHECK_EQ(77777777, r.Call());
}
@@ -1298,13 +1298,13 @@ WASM_EXEC_TEST(LoadMemI64_alignment) {
BUILD(r,
WASM_LOAD_MEM_ALIGNMENT(MachineType::Int64(), WASM_I8(0), alignment));
- memory[0] = 0xaabbccdd00112233LL;
+ module.WriteMemory<int64_t>(&memory[0], 0xaabbccdd00112233LL);
CHECK_EQ(0xaabbccdd00112233LL, r.Call());
- memory[0] = 0x33aabbccdd001122LL;
+ module.WriteMemory<int64_t>(&memory[0], 0x33aabbccdd001122LL);
CHECK_EQ(0x33aabbccdd001122LL, r.Call());
- memory[0] = 77777777;
+ module.WriteMemory<int64_t>(&memory[0], 77777777);
CHECK_EQ(77777777, r.Call());
}
}
@@ -1338,7 +1338,7 @@ WASM_EXEC_TEST(MemI64_Sum) {
module.RandomizeMemory(i * 33);
uint64_t expected = 0;
for (size_t j = kNumElems - 1; j > 0; j--) {
- expected += memory[j];
+ expected += module.ReadMemory(&memory[j]);
}
uint64_t result = r.Call(8 * (kNumElems - 1));
CHECK_EQ(expected, result);
@@ -1355,10 +1355,10 @@ WASM_EXEC_TEST(StoreMemI64_alignment) {
BUILD(r, WASM_STORE_MEM_ALIGNMENT(MachineType::Int64(), WASM_ZERO, i,
WASM_GET_LOCAL(0)));
module.RandomizeMemory(1111);
- memory[0] = 0;
+ module.WriteMemory<int64_t>(&memory[0], 0);
CHECK_EQ(kWritten, r.Call(kWritten));
- CHECK_EQ(kWritten, memory[0]);
+ CHECK_EQ(kWritten, module.ReadMemory(&memory[0]));
}
}
@@ -1376,7 +1376,7 @@ WASM_EXEC_TEST(I64Global) {
WASM_I64_SCONVERT_I32(WASM_GET_LOCAL(0)))),
WASM_ZERO));
- *global = 0xFFFFFFFFFFFFFFFFLL;
+ module.WriteMemory<int64_t>(global, 0xFFFFFFFFFFFFFFFFLL);
for (int i = 9; i < 444444; i += 111111) {
int64_t expected = *global & i;
r.Call(i);
« no previous file with comments | « test/cctest/wasm/test-run-wasm.cc ('k') | test/cctest/wasm/wasm-run-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698