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

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

Issue 2389263005: [wasm] grow_memory(0) is the same as memory_size() (Closed)
Patch Set: Created 4 years, 2 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 | « src/wasm/wasm-module.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/wasm/wasm-module.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698