diff options
Diffstat (limited to 'test/passes/emit-js-wrapper=a.js.wast.js')
-rw-r--r-- | test/passes/emit-js-wrapper=a.js.wast.js | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/test/passes/emit-js-wrapper=a.js.wast.js b/test/passes/emit-js-wrapper=a.js.wast.js index 778f43827..f2e828c2b 100644 --- a/test/passes/emit-js-wrapper=a.js.wast.js +++ b/test/passes/emit-js-wrapper=a.js.wast.js @@ -1,6 +1,7 @@ if (typeof console === 'undefined') { console = { log: print }; } +var tempRet0; var binary; if (typeof process === 'object' && typeof require === 'function' /* node.js detection */) { var args = process.argv.slice(2); @@ -19,7 +20,18 @@ if (typeof process === 'object' && typeof require === 'function' /* node.js dete binary = read(args[0], 'binary'); } } -var instance = new WebAssembly.Instance(new WebAssembly.Module(binary), {}); +var instance = new WebAssembly.Instance(new WebAssembly.Module(binary), { + 'fuzzing-support': { + 'log-i32': function(x) { console.log('i32: ' + x) }, + 'log-i64': function(x, y) { console.log('i64: ' + x + ', ' + y) }, + 'log-f32': function(x) { console.log('f32: ' + x) }, + 'log-f64': function(x) { console.log('f64: ' + x) } + }, + 'env': { + 'setTempRet0': function(x) { tempRet0 = x }, + 'getTempRet0': function() { return tempRet0 }, + }, +}); if (instance.exports.hangLimitInitializer) instance.exports.hangLimitInitializer(); try { console.log('calling: add'); @@ -36,9 +48,23 @@ instance.exports.no_return(0); } if (instance.exports.hangLimitInitializer) instance.exports.hangLimitInitializer(); try { + console.log('calling: types'); +instance.exports.types(0, 0, 0, 0, 0); +} catch (e) { + console.log(' exception: ' + e); +} +if (instance.exports.hangLimitInitializer) instance.exports.hangLimitInitializer(); +try { console.log('calling: types2'); instance.exports.types2(0, 0, 0); } catch (e) { console.log(' exception: ' + e); } +if (instance.exports.hangLimitInitializer) instance.exports.hangLimitInitializer(); +try { + console.log('calling: types3'); + console.log(' result: ' + instance.exports.types3(0, 0, 0)); +} catch (e) { + console.log(' exception: ' + e); +} console.log('done.') |