summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/regress/builtin-import-sigs.js
blob: 50aa2a41d16473bf52b6601831b79a9e7e1e0291 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var code = wasmTextToBinary(`(module
    (import "" "builtin" (func $one))
    (import "" "builtin" (func $two (param i32)))
    (import "" "builtin" (func $three (result i32)))
    (import "" "builtin" (func $four (param f32 f32 f32 f32 f32 f32 f32 f32 f32 f32 f32 f32) (result f32)))
    (func (export "run")
        (call $one)
        (call $two (i32.const 0))
        (drop (call $three))
        (drop (call $four (f32.const 0) (f32.const 0) (f32.const 0) (f32.const 0) (f32.const 0) (f32.const 0) (f32.const 0) (f32.const 0) (f32.const 0) (f32.const 0) (f32.const 0) (f32.const 0)))
    )
)`);
var m = new WebAssembly.Module(code);
var i = new WebAssembly.Instance(m, {'':{builtin:Math.sin}});
i.exports.run();