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 b8e27d942d87569518b954cf897deb706282574b..70d461b62785391181c5b25a7d847ea75d70ac2e 100644 |
--- a/test/cctest/wasm/test-run-wasm.cc |
+++ b/test/cctest/wasm/test-run-wasm.cc |
@@ -2818,3 +2818,15 @@ TEST(Compile_Wasm_CallIndirect_Many_f32) { CompileCallIndirectMany(kAstF32); } |
TEST(Compile_Wasm_CallIndirect_Many_f64) { CompileCallIndirectMany(kAstF64); } |
+ |
+TEST(Run_WASM_Int32RemS_dead) { |
+ WasmRunner<int32_t> r(MachineType::Int32(), MachineType::Int32()); |
+ BUILD(r, WASM_I32_REMS(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)), WASM_ZERO); |
+ const int32_t kMin = std::numeric_limits<int32_t>::min(); |
+ CHECK_EQ(0, r.Call(133, 100)); |
+ CHECK_EQ(0, r.Call(kMin, -1)); |
+ CHECK_EQ(0, r.Call(0, 1)); |
+ CHECK_TRAP(r.Call(100, 0)); |
+ CHECK_TRAP(r.Call(-1001, 0)); |
+ CHECK_TRAP(r.Call(kMin, 0)); |
+} |