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 766f5d03dba17cf0cb4b2fe6e1a86b7a7f1d4c4c..394a72367740720743895158b4965f9aef930cf8 100644 |
--- a/test/cctest/wasm/test-run-wasm-module.cc |
+++ b/test/cctest/wasm/test-run-wasm-module.cc |
@@ -253,6 +253,21 @@ TEST(Run_WasmModule_Serialization) { |
} |
} |
+TEST(MemorySize) { |
+ // 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_MEMORY_SIZE}; |
+ f->EmitCode(code, sizeof(code)); |
+ TestModule(&zone, builder, kExpectedValue); |
+} |
+ |
TEST(Run_WasmModule_MemSize_GrowMem) { |
// Initial memory size = 16 + GrowMemory(10) |
static const int kExpectedValue = 26; |