Index: test/mjsunit/wasm/grow-memory.js |
diff --git a/test/mjsunit/wasm/grow-memory.js b/test/mjsunit/wasm/grow-memory.js |
index 27aca22d1a68060dc3ea95371046cbe5be9cbf4f..dd0bdc31a55cc7d097b38876fcf8706dd76dc729 100644 |
--- a/test/mjsunit/wasm/grow-memory.js |
+++ b/test/mjsunit/wasm/grow-memory.js |
@@ -117,3 +117,12 @@ function testGrowMemoryTrapMaxPages() { |
} |
testGrowMemoryTrapMaxPages(); |
+ |
+(function testGrowMemoryTrapsWithNonSmiInput() { |
+ var builder = genGrowMemoryBuilder(); |
+ var module = builder.instantiate(); |
+ function growMem(pages) { return module.exports.grow_memory(pages); } |
+ // The parameter of grow_memory is unsigned. Therefore -1 stands for |
+ // UINT32_MIN, which cannot be represented as SMI. |
+ assertEquals(-1, growMem(-1)); |
+})(); |
gdeepti
2016/08/30 02:19:56
Nit: Test not consistent with the format of other
ahaas
2016/08/30 06:49:53
You are right, it should be consistent.
Done.
|