Chromium Code Reviews| Index: test/mjsunit/wasm/import-memory.js |
| diff --git a/test/mjsunit/wasm/import-memory.js b/test/mjsunit/wasm/import-memory.js |
| index 3b70332f97bc5eb95d2dbd81135df3a89204d0c2..2b6c7567089062e3172e512109d8caea53cf8776 100644 |
| --- a/test/mjsunit/wasm/import-memory.js |
| +++ b/test/mjsunit/wasm/import-memory.js |
| @@ -366,3 +366,20 @@ load("test/mjsunit/wasm/wasm-module-builder.js"); |
| verify_mem_size(++current_mem_size); |
| } |
| })(); |
| + |
| +(function TestExportGrow() { |
| + print("TestExportGrow"); |
| + let builder = new WasmModuleBuilder(); |
| + builder.addMemory(1, 5, true); |
| + builder.exportMemoryAs("exported_mem"); |
| + builder.addFunction("mem_size", kSig_i_v) |
| + .addBody([kExprMemorySize, kMemoryZero]) |
| + .exportFunc(); |
| + builder.addFunction("grow", kSig_i_i) |
| + .addBody([kExprGetLocal, 0, kExprGrowMemory, kMemoryZero]) |
| + .exportFunc(); |
| + instance = builder.instantiate(); |
| + assertEquals(1, instance.exports.grow(2)); |
| + assertEquals(3, instance.exports.mem_size()); |
| + assertEquals(kPageSize, instance.exports.exported_mem.buffer.byteLength); |
|
gdeepti
2016/12/04 17:48:37
As per my understanding, this should be the correc
titzer
2016/12/05 09:40:54
Yes, that's right.
gdeepti
2016/12/05 17:31:07
Thanks! Bot failures fixed with latest patch.
|
| +})(); |