blob: 1e1be885f91b86f13214c138fcbdd1179e9f1d41 [file] [edit]
//@ requireOptions("--useWasmSIMD=1")
//@ skip if !$isSIMDPlatform
import { instantiate } from "../wabt-wrapper.js"
import * as assert from "../assert.js"
const N = 1000
let wat = `
(module
(func $f0 (result `
for (let i = 0; i < N; ++i)
wat += `f64 `
wat += `) (local $l0 f64) `
for (let i = 0; i < N; ++i)
wat += `(local.get $l0) `
wat += `
)
(func $f1 (export "test")
(call $f0)
(return))
)
`
async function test() {
const instance = await instantiate(wat, {}, { simd: true })
const { test } = instance.exports
for (let i = 0; i < wasmTestLoopCount; ++i) {
assert.eq(test(42), undefined)
}
}
await assert.asyncTest(test())