| import * as assert from '../assert.js' |
| import Builder from '../Builder.js' |
| .Function("bar", { params: ["f32", "f32"], ret: "f32" }, []) |
| .Function("foo", { params: ["f32", "f32"], ret: "f32" }, []) |
| const bin = b.WebAssembly() |
| const instance = new WebAssembly.Instance(new WebAssembly.Module(bin.get())); |
| let x = new Float32Array(3); |
| assert.eq(instance.exports.bar(x[0], x[1]), x[2]); |
| assert.eq(instance.exports.foo(x[0], x[1]), x[2]); |
| assert.eq(instance.exports.bar(x[0], x[1]), x[2]); |
| assert.eq(instance.exports.foo(x[0], x[1]), x[2]); |