summaryrefslogtreecommitdiff
path: root/test/binaryen.js/kitchen-sink.js
diff options
context:
space:
mode:
authorDaniel Wirtz <dcode@dcode.io>2020-09-09 03:40:09 +0200
committerGitHub <noreply@github.com>2020-09-09 03:40:09 +0200
commit916ce6f1a9f7c85102a8c69f593b301c8df5d19d (patch)
tree93b22be9f2c0718248528d140b05221cb6878600 /test/binaryen.js/kitchen-sink.js
parent0fdcf5b51a0c8c379b2d3ad8262aa22bb234f0e9 (diff)
downloadbinaryen-916ce6f1a9f7c85102a8c69f593b301c8df5d19d.tar.gz
binaryen-916ce6f1a9f7c85102a8c69f593b301c8df5d19d.tar.bz2
binaryen-916ce6f1a9f7c85102a8c69f593b301c8df5d19d.zip
Update reference types (#3084)
Align with the current state of the reference types proposal: * Remove `nullref` * Remove `externref` and `funcref` subtyping * A `Literal` of a nullable reference type can now represent `null` (previously was type `nullref`) * Update the tests and temporarily comment out those tests relying on subtyping
Diffstat (limited to 'test/binaryen.js/kitchen-sink.js')
-rw-r--r--test/binaryen.js/kitchen-sink.js33
1 files changed, 18 insertions, 15 deletions
diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js
index 93ed27334..e82090858 100644
--- a/test/binaryen.js/kitchen-sink.js
+++ b/test/binaryen.js/kitchen-sink.js
@@ -48,44 +48,47 @@ function makeDroppedInt32(x) {
function test_types() {
console.log(" // BinaryenTypeNone: " + binaryen.none);
- console.log(" //", binaryen.expandType(binaryen.none));
+ console.log(" //", binaryen.expandType(binaryen.none).join(","));
console.log(" // BinaryenTypeUnreachable: " + binaryen.unreachable);
- console.log(" //", binaryen.expandType(binaryen.unreachable));
+ console.log(" //", binaryen.expandType(binaryen.unreachable).join(","));
console.log(" // BinaryenTypeInt32: " + binaryen.i32);
- console.log(" //", binaryen.expandType(binaryen.i32));
+ console.log(" //", binaryen.expandType(binaryen.i32).join(","));
console.log(" // BinaryenTypeInt64: " + binaryen.i64);
- console.log(" //", binaryen.expandType(binaryen.i64));
+ console.log(" //", binaryen.expandType(binaryen.i64).join(","));
console.log(" // BinaryenTypeFloat32: " + binaryen.f32);
- console.log(" //", binaryen.expandType(binaryen.f32));
+ console.log(" //", binaryen.expandType(binaryen.f32).join(","));
console.log(" // BinaryenTypeFloat64: " + binaryen.f64);
- console.log(" //", binaryen.expandType(binaryen.f64));
+ console.log(" //", binaryen.expandType(binaryen.f64).join(","));
console.log(" // BinaryenTypeVec128: " + binaryen.v128);
- console.log(" //", binaryen.expandType(binaryen.v128));
+ console.log(" //", binaryen.expandType(binaryen.v128).join(","));
+
+ console.log(" // BinaryenTypeFuncref: " + binaryen.funcref);
+ console.log(" //", binaryen.expandType(binaryen.funcref).join(","));
console.log(" // BinaryenTypeExternref: " + binaryen.externref);
- console.log(" //", binaryen.expandType(binaryen.externref));
+ console.log(" //", binaryen.expandType(binaryen.externref).join(","));
console.log(" // BinaryenTypeExnref: " + binaryen.exnref);
- console.log(" //", binaryen.expandType(binaryen.exnref));
+ console.log(" //", binaryen.expandType(binaryen.exnref).join(","));
console.log(" // BinaryenTypeAuto: " + binaryen.auto);
var i32_pair = binaryen.createType([binaryen.i32, binaryen.i32]);
- console.log(" //", binaryen.expandType(i32_pair));
+ console.log(" //", binaryen.expandType(i32_pair).join(","));
var duplicate_pair = binaryen.createType([binaryen.i32, binaryen.i32]);
- console.log(" //", binaryen.expandType(duplicate_pair));
+ console.log(" //", binaryen.expandType(duplicate_pair).join(","));
assert(i32_pair == duplicate_pair);
var f32_pair = binaryen.createType([binaryen.f32, binaryen.f32]);
- console.log(" //", binaryen.expandType(f32_pair));
+ console.log(" //", binaryen.expandType(f32_pair).join(","));
}
function test_features() {
@@ -502,9 +505,10 @@ function test_core() {
module.return_call_indirect(makeInt32(2449), [ makeInt32(13), makeInt64(37, 0), makeFloat32(1.3), makeFloat64(3.7) ], iIfF, binaryen.i32),
// Reference types
- module.ref.is_null(module.ref.null()),
+ module.ref.is_null(module.ref.null(binaryen.externref)),
+ module.ref.is_null(module.ref.null(binaryen.funcref)),
module.ref.is_null(module.ref.func("kitchen()sinker")),
- module.select(temp10, module.ref.null(), module.ref.func("kitchen()sinker"), binaryen.funcref),
+ module.select(temp10, module.ref.null(binaryen.funcref), module.ref.func("kitchen()sinker"), binaryen.funcref),
// Exception handling
module.try(
@@ -563,7 +567,6 @@ function test_core() {
module.v128.pop(),
module.externref.pop(),
module.funcref.pop(),
- module.nullref.pop(),
module.exnref.pop(),
// TODO: Host
module.nop(),