# Test basic Wasm functionality that uses core Wasm types.

exec cue eval -E --out cue
cmp stdout out/wasm

-- a.cue --
@extern("wasm")
package p

add: _ @extern("basic.wasm", abi=c, sig="func(int64, int64): int64")
mul: _ @extern("basic.wasm", abi=c, sig="func(float64, float64): float64")
not: _ @extern("basic.wasm", abi=c, sig="func(bool): bool")

x0: add(1, 2)
x1: add(-1, 2)
x2: add(100, 1)

y0: mul(3.0, 5.0)
y1: mul(-2.5, 3.37)
y2: mul(1.234, 5.678)

z: not(true)
-- basic.wasm --
-- out/wasm --
add: add
mul: mul
not: not()
x0:  3
x1:  1
x2:  101
y0:  15.0
y1:  -8.425
y2:  7.006652
z:   false
