summaryrefslogtreecommitdiff
path: root/test/binaryen.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/binaryen.js')
-rw-r--r--test/binaryen.js/exception-handling.js.txt2
-rw-r--r--test/binaryen.js/kitchen-sink.js33
-rw-r--r--test/binaryen.js/kitchen-sink.js.txt52
3 files changed, 48 insertions, 39 deletions
diff --git a/test/binaryen.js/exception-handling.js.txt b/test/binaryen.js/exception-handling.js.txt
index 380ce34d6..d590d0b4b 100644
--- a/test/binaryen.js/exception-handling.js.txt
+++ b/test/binaryen.js/exception-handling.js.txt
@@ -29,6 +29,6 @@
)
getExpressionInfo(throw) = {"id":43,"type":1,"event":"e"}
-getExpressionInfo(br_on_exn) = {"id":45,"type":10,"name":"l","event":"e"}
+getExpressionInfo(br_on_exn) = {"id":45,"type":9,"name":"l","event":"e"}
getExpressionInfo(rethrow) = {"id":44,"type":1}
getExpressionInfo(try) = {"id":42,"type":0}
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(),
diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt
index c58f1f563..917525eeb 100644
--- a/test/binaryen.js/kitchen-sink.js.txt
+++ b/test/binaryen.js/kitchen-sink.js.txt
@@ -1,25 +1,27 @@
// BinaryenTypeNone: 0
- // []
+ //
// BinaryenTypeUnreachable: 1
- // [ 1 ]
+ // 1
// BinaryenTypeInt32: 2
- // [ 2 ]
+ // 2
// BinaryenTypeInt64: 3
- // [ 3 ]
+ // 3
// BinaryenTypeFloat32: 4
- // [ 4 ]
+ // 4
// BinaryenTypeFloat64: 5
- // [ 5 ]
+ // 5
// BinaryenTypeVec128: 6
- // [ 6 ]
+ // 6
+ // BinaryenTypeFuncref: 7
+ // 7
// BinaryenTypeExternref: 8
- // [ 8 ]
- // BinaryenTypeExnref: 10
- // [ 10 ]
+ // 8
+ // BinaryenTypeExnref: 9
+ // 9
// BinaryenTypeAuto: -1
- // [ 2, 2 ]
- // [ 2, 2 ]
- // [ 4, 4 ]
+ // 2,2
+ // 2,2
+ // 4,4
Features.MVP: 0
Features.Atomics: 1
Features.BulkMemory: 16
@@ -1811,7 +1813,12 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
)
(drop
(ref.is_null
- (ref.null)
+ (ref.null extern)
+ )
+ )
+ (drop
+ (ref.is_null
+ (ref.null func)
)
)
(drop
@@ -1821,7 +1828,7 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
)
(drop
(select (result funcref)
- (ref.null)
+ (ref.null func)
(ref.func "$kitchen()sinker")
(i32.const 1)
)
@@ -1907,9 +1914,6 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
(funcref.pop)
)
(drop
- (nullref.pop)
- )
- (drop
(exnref.pop)
)
(nop)
@@ -3649,7 +3653,12 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
)
(drop
(ref.is_null
- (ref.null)
+ (ref.null extern)
+ )
+ )
+ (drop
+ (ref.is_null
+ (ref.null func)
)
)
(drop
@@ -3659,7 +3668,7 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
)
(drop
(select (result funcref)
- (ref.null)
+ (ref.null func)
(ref.func "$kitchen()sinker")
(i32.const 1)
)
@@ -3745,9 +3754,6 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
(funcref.pop)
)
(drop
- (nullref.pop)
- )
- (drop
(exnref.pop)
)
(nop)