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

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

Issue 1804513002: [wasm] Int64Lowering of I64Div and I64Rem. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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
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 78af1078f91bbbd83f3be040e1dbe151ce268faf..42a6f78e72a976cca164c342b51d60bdffc03a85 100644
--- a/test/cctest/wasm/test-run-wasm.cc
+++ b/test/cctest/wasm/test-run-wasm.cc
@@ -612,86 +612,6 @@ TEST(Run_WASM_Int32DivS_trap_effect) {
CHECK_TRAP(r.Call(0, 0));
}
-
-#if WASM_64
-#define as64(x) static_cast<int64_t>(x)
-TEST(Run_WASM_Int64DivS_trap) {
- WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64());
- BUILD(r, WASM_I64_DIVS(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
- CHECK_EQ(0, r.Call(as64(0), as64(100)));
- CHECK_TRAP64(r.Call(as64(100), as64(0)));
- CHECK_TRAP64(r.Call(as64(-1001), as64(0)));
- CHECK_TRAP64(r.Call(std::numeric_limits<int64_t>::min(), as64(-1)));
- CHECK_TRAP64(r.Call(std::numeric_limits<int64_t>::min(), as64(0)));
-}
-
-
-TEST(Run_WASM_Int64RemS_trap) {
- WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64());
- BUILD(r, WASM_I64_REMS(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
- CHECK_EQ(33, r.Call(as64(133), as64(100)));
- CHECK_EQ(0, r.Call(std::numeric_limits<int64_t>::min(), as64(-1)));
- CHECK_TRAP64(r.Call(as64(100), as64(0)));
- CHECK_TRAP64(r.Call(as64(-1001), as64(0)));
- CHECK_TRAP64(r.Call(std::numeric_limits<int64_t>::min(), as64(0)));
-}
-
-
-TEST(Run_WASM_Int64DivU_trap) {
- WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64());
- BUILD(r, WASM_I64_DIVU(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
- CHECK_EQ(0, r.Call(as64(0), as64(100)));
- CHECK_EQ(0, r.Call(std::numeric_limits<int64_t>::min(), as64(-1)));
- CHECK_TRAP64(r.Call(as64(100), as64(0)));
- CHECK_TRAP64(r.Call(as64(-1001), as64(0)));
- CHECK_TRAP64(r.Call(std::numeric_limits<int64_t>::min(), as64(0)));
-}
-
-
-TEST(Run_WASM_Int64RemU_trap) {
- WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64());
- BUILD(r, WASM_I64_REMU(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
- CHECK_EQ(17, r.Call(as64(217), as64(100)));
- CHECK_TRAP64(r.Call(as64(100), as64(0)));
- CHECK_TRAP64(r.Call(as64(-1001), as64(0)));
- CHECK_TRAP64(r.Call(std::numeric_limits<int64_t>::min(), as64(0)));
- CHECK_EQ(std::numeric_limits<int64_t>::min(),
- r.Call(std::numeric_limits<int64_t>::min(), as64(-1)));
-}
-
-
-TEST(Run_WASM_Int64DivS_byzero_const) {
- for (int8_t denom = -2; denom < 8; denom++) {
- WasmRunner<int64_t> r(MachineType::Int64());
- BUILD(r, WASM_I64_DIVS(WASM_GET_LOCAL(0), WASM_I64V_1(denom)));
- for (int64_t val = -7; val < 8; val++) {
- if (denom == 0) {
- CHECK_TRAP64(r.Call(val));
- } else {
- CHECK_EQ(val / denom, r.Call(val));
- }
- }
- }
-}
-
-
-TEST(Run_WASM_Int64DivU_byzero_const) {
- for (uint64_t denom = 0xfffffffffffffffe; denom < 8; denom++) {
- WasmRunner<uint64_t> r(MachineType::Uint64());
- BUILD(r, WASM_I64_DIVU(WASM_GET_LOCAL(0), WASM_I64V_1(denom)));
-
- for (uint64_t val = 0xfffffffffffffff0; val < 8; val++) {
- if (denom == 0) {
- CHECK_TRAP64(r.Call(val));
- } else {
- CHECK_EQ(val / denom, r.Call(val));
- }
- }
- }
-}
-#endif
-
-
void TestFloat32Binop(WasmOpcode opcode, int32_t expected, float a, float b) {
{
WasmRunner<int32_t> r;

Powered by Google App Engine
This is Rietveld 408576698