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

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

Issue 2386183004: [wasm] Call a runtime function for a MemorySize instruction. (Closed)
Patch Set: Comments addressed 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 | « test/cctest/wasm/test-run-wasm.cc ('k') | test/mjsunit/regress/wasm/regression-651961.js » ('j') | 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 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;
« no previous file with comments | « test/cctest/wasm/test-run-wasm.cc ('k') | test/mjsunit/regress/wasm/regression-651961.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698