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

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

Issue 1968493002: [wasm] Introduce special bytecodes for asm.js division/remainder instead of relying on module state. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Move asm.js tests to their own file. 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/cctest.gyp ('k') | test/cctest/wasm/test-run-wasm-asmjs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/test-run-wasm.cc
diff --git a/test/cctest/wasm/test-run-wasm.cc b/test/cctest/wasm/test-run-wasm.cc
index 84883295ee7b7be2fa0dc8c2de64a71738429b00..79685e31051523297e8eea98af3c58169fc66a05 100644
--- a/test/cctest/wasm/test-run-wasm.cc
+++ b/test/cctest/wasm/test-run-wasm.cc
@@ -409,59 +409,6 @@ TEST(Run_WASM_Int32RemU_trap) {
CHECK_EQ(kMin, r.Call(kMin, -1));
}
-TEST(Run_WASM_Int32DivS_asmjs) {
- TestingModule module;
- module.origin = kAsmJsOrigin;
- WasmRunner<int32_t> r(&module, MachineType::Int32(), MachineType::Int32());
- BUILD(r, WASM_I32_DIVS(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
- const int32_t kMin = std::numeric_limits<int32_t>::min();
- CHECK_EQ(0, r.Call(0, 100));
- CHECK_EQ(0, r.Call(100, 0));
- CHECK_EQ(0, r.Call(-1001, 0));
- CHECK_EQ(kMin, r.Call(kMin, -1));
- CHECK_EQ(0, r.Call(kMin, 0));
-}
-
-TEST(Run_WASM_Int32RemS_asmjs) {
- TestingModule module;
- module.origin = kAsmJsOrigin;
- WasmRunner<int32_t> r(&module, MachineType::Int32(), MachineType::Int32());
- BUILD(r, WASM_I32_REMS(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
- const int32_t kMin = std::numeric_limits<int32_t>::min();
- CHECK_EQ(33, r.Call(133, 100));
- CHECK_EQ(0, r.Call(kMin, -1));
- CHECK_EQ(0, r.Call(100, 0));
- CHECK_EQ(0, r.Call(-1001, 0));
- CHECK_EQ(0, r.Call(kMin, 0));
-}
-
-TEST(Run_WASM_Int32DivU_asmjs) {
- TestingModule module;
- module.origin = kAsmJsOrigin;
- WasmRunner<int32_t> r(&module, MachineType::Int32(), MachineType::Int32());
- BUILD(r, WASM_I32_DIVU(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
- const int32_t kMin = std::numeric_limits<int32_t>::min();
- CHECK_EQ(0, r.Call(0, 100));
- CHECK_EQ(0, r.Call(kMin, -1));
- CHECK_EQ(0, r.Call(100, 0));
- CHECK_EQ(0, r.Call(-1001, 0));
- CHECK_EQ(0, r.Call(kMin, 0));
-}
-
-TEST(Run_WASM_Int32RemU_asmjs) {
- TestingModule module;
- module.origin = kAsmJsOrigin;
- WasmRunner<int32_t> r(&module, MachineType::Int32(), MachineType::Int32());
- BUILD(r, WASM_I32_REMU(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
- const int32_t kMin = std::numeric_limits<int32_t>::min();
- CHECK_EQ(17, r.Call(217, 100));
- CHECK_EQ(0, r.Call(100, 0));
- CHECK_EQ(0, r.Call(-1001, 0));
- CHECK_EQ(0, r.Call(kMin, 0));
- CHECK_EQ(kMin, r.Call(kMin, -1));
-}
-
-
TEST(Run_WASM_Int32DivS_byzero_const) {
for (int8_t denom = -2; denom < 8; denom++) {
WasmRunner<int32_t> r(MachineType::Int32());
@@ -1403,28 +1350,6 @@ TEST(Run_Wasm_LoadMemI32_oob) {
}
-TEST(Run_Wasm_LoadMemI32_oob_asm) {
- TestingModule module;
- module.origin = kAsmJsOrigin;
- int32_t* memory = module.AddMemoryElems<int32_t>(8);
- WasmRunner<int32_t> r(&module, MachineType::Uint32());
- module.RandomizeMemory(1112);
-
- BUILD(r, WASM_LOAD_MEM(MachineType::Int32(), WASM_GET_LOCAL(0)));
-
- memory[0] = 999999;
- CHECK_EQ(999999, r.Call(0u));
- // TODO(titzer): offset 29-31 should also be OOB.
- for (uint32_t offset = 32; offset < 40; offset++) {
- CHECK_EQ(0, r.Call(offset));
- }
-
- for (uint32_t offset = 0x80000000; offset < 0x80000010; offset++) {
- CHECK_EQ(0, r.Call(offset));
- }
-}
-
-
TEST(Run_Wasm_LoadMem_offset_oob) {
TestingModule module;
module.AddMemoryElems<int32_t>(8);
« no previous file with comments | « test/cctest/cctest.gyp ('k') | test/cctest/wasm/test-run-wasm-asmjs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698