Index: test/mjsunit/wasm/grow-memory.js |
diff --git a/test/mjsunit/wasm/grow-memory.js b/test/mjsunit/wasm/grow-memory.js |
index 473760fc3d1c2601cbc9274f6692762902b01798..93db651c1bb49633800585c6382ae071e4934c7b 100644 |
--- a/test/mjsunit/wasm/grow-memory.js |
+++ b/test/mjsunit/wasm/grow-memory.js |
@@ -128,3 +128,19 @@ function testGrowMemoryTrapsWithNonSmiInput() { |
}; |
testGrowMemoryTrapsWithNonSmiInput(); |
+ |
+function testGrowMemoryCurrentMemory() { |
+ var builder = genGrowMemoryBuilder(); |
+ builder.addMemory(1, 1, false); |
+ builder.addFunction("memory_size", kSig_i_v) |
+ .addBody([kExprMemorySize]) |
+ .exportFunc(); |
+ var module = builder.instantiate(); |
+ function growMem(pages) { return module.exports.grow_memory(pages); } |
+ function MemSize() { return module.exports.memory_size(); } |
+ assertEquals(65536, MemSize()); |
+ assertEquals(1, growMem(1)); |
+ assertEquals(131072, MemSize()); |
+} |
+ |
+testGrowMemoryCurrentMemory(); |