Support for select instructions on vector values (#696)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
This commit is contained in:
@@ -15,6 +15,8 @@ var ctx = context.Background()
|
||||
var (
|
||||
//go:embed testdata/695.wasm
|
||||
case695 []byte
|
||||
//go:embed testdata/696.wasm
|
||||
case696 []byte
|
||||
)
|
||||
|
||||
func newRuntimeCompiler() wazero.Runtime {
|
||||
@@ -52,3 +54,36 @@ func Test695(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test696(t *testing.T) {
|
||||
if !platform.CompilerSupported() {
|
||||
return
|
||||
}
|
||||
|
||||
functionNames := [4]string{
|
||||
"select with 0 / after calling dummy",
|
||||
"select with 0",
|
||||
"typed select with 1 / after calling dummy",
|
||||
"typed select with 1",
|
||||
}
|
||||
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
r wazero.Runtime
|
||||
}{
|
||||
{name: "compiler", r: newRuntimeCompiler()},
|
||||
{name: "interpreter", r: newRuntimeInterpreter()},
|
||||
} {
|
||||
tc := tc
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
defer tc.r.Close(ctx)
|
||||
module, err := tc.r.InstantiateModuleFromBinary(ctx, case696)
|
||||
require.NoError(t, err)
|
||||
|
||||
for _, name := range functionNames {
|
||||
_, err := module.ExportedFunction(name).Call(ctx)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user