Index: test/mjsunit/wasm/ffi-error.js |
diff --git a/test/mjsunit/wasm/ffi-error.js b/test/mjsunit/wasm/ffi-error.js |
index 81dc47806e767f00a8f3bdec9230deae2e3fc05d..aca5123d3bec699edd950cb0861f83bd02cb78f8 100644 |
--- a/test/mjsunit/wasm/ffi-error.js |
+++ b/test/mjsunit/wasm/ffi-error.js |
@@ -78,3 +78,23 @@ assertThrows(function() { |
module.exports.function_with_invalid_signature(33, 88); |
}, TypeError); |
})(); |
+ |
+ |
+(function I64JSImportThrows() { |
+ var builder = new WasmModuleBuilder(); |
+ var sig_index = builder.addType(kSig_i_i); |
+ var sig_i64_index = builder.addType(kSig_i_l); |
+ var index = builder.addImport("func", sig_i64_index); |
+ builder.addFunction("main", sig_index) |
+ .addBody([ |
+ kExprGetLocal, 0, |
+ kExprI64SConvertI32, |
+ kExprCallImport, kArity1, index // -- |
+ ]) // -- |
+ .exportFunc(); |
+ var func = function() {return {};}; |
+ var main = builder.instantiate({func: func}).exports.main; |
+ assertThrows(function() { |
+ main(13); |
+ }, TypeError); |
+})(); |