Index: test/cctest/wasm/test-run-wasm-module.cc |
diff --git a/test/cctest/wasm/test-run-wasm-module.cc b/test/cctest/wasm/test-run-wasm-module.cc |
index b358208bc3aebb829695453ed9ba80a00041073e..0e2ed1b0fe2e377a2e5ff09b39af4c9bb93424ab 100644 |
--- a/test/cctest/wasm/test-run-wasm-module.cc |
+++ b/test/cctest/wasm/test-run-wasm-module.cc |
@@ -283,6 +283,21 @@ TEST(Run_WasmModule_MemSize_GrowMem) { |
TestModule(&zone, builder, kExpectedValue); |
} |
+TEST(GrowMemoryZero) { |
+ // Initial memory size is 16, see wasm-module-builder.cc |
+ static const int kExpectedValue = 16; |
+ TestSignatures sigs; |
+ v8::internal::AccountingAllocator allocator; |
+ Zone zone(&allocator); |
+ |
+ WasmModuleBuilder* builder = new (&zone) WasmModuleBuilder(&zone); |
+ WasmFunctionBuilder* f = builder->AddFunction(sigs.i_v()); |
+ ExportAsMain(f); |
+ byte code[] = {WASM_GROW_MEMORY(WASM_I32V(0))}; |
+ f->EmitCode(code, sizeof(code)); |
+ TestModule(&zone, builder, kExpectedValue); |
+} |
+ |
TEST(Run_WasmModule_GrowMemoryInIf) { |
TestSignatures sigs; |
v8::internal::AccountingAllocator allocator; |