summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2021-01-22 18:07:46 +0900
committerGitHub <noreply@github.com>2021-01-22 18:07:46 +0900
commit6d62e3c4be466888239a89c2e98713f60074aaea (patch)
treef2b55ef6eed4be74c2faee998f15ab46231083a9 /test
parent69ff866fc7e54f25d8d8598581aa3553cb87603b (diff)
downloadbinaryen-6d62e3c4be466888239a89c2e98713f60074aaea.tar.gz
binaryen-6d62e3c4be466888239a89c2e98713f60074aaea.tar.bz2
binaryen-6d62e3c4be466888239a89c2e98713f60074aaea.zip
Remove exnref and br_on_exn (#3505)
This removes `exnref` type and `br_on_exn` instruction.
Diffstat (limited to 'test')
-rw-r--r--test/binaryen.js/expressions.js37
-rw-r--r--test/binaryen.js/expressions.js.txt5
-rw-r--r--test/binaryen.js/kitchen-sink.js7
-rw-r--r--test/binaryen.js/kitchen-sink.js.txt53
-rw-r--r--test/ctor-eval/bad-indirect-call3.wast2
-rw-r--r--test/ctor-eval/bad-indirect-call3.wast.out4
-rw-r--r--test/example/c-api-kitchen-sink.c11
-rw-r--r--test/example/c-api-kitchen-sink.txt17
-rw-r--r--test/example/typeinfo.cpp13
-rw-r--r--test/example/typeinfo.txt5
-rw-r--r--test/exception-handling.wast4
-rw-r--r--test/exception-handling.wast.from-wast4
-rw-r--r--test/exception-handling.wast.fromBinary4
-rw-r--r--test/exception-handling.wast.fromBinary.noDebugInfo14
-rw-r--r--test/passes/code-pushing_all-features.txt17
-rw-r--r--test/passes/code-pushing_all-features.wast14
-rw-r--r--test/passes/inlining_all-features.txt33
-rw-r--r--test/passes/inlining_all-features.wast28
-rw-r--r--test/passes/instrument-locals_all-features_disable-typed-function-references.txt82
-rw-r--r--test/passes/instrument-locals_all-features_disable-typed-function-references.wast5
-rw-r--r--test/passes/precompute_all-features.txt10
-rw-r--r--test/passes/precompute_all-features.wast15
-rw-r--r--test/passes/remove-unused-names_code-folding_all-features.txt42
-rw-r--r--test/passes/remove-unused-names_code-folding_all-features.wast27
-rw-r--r--test/passes/remove-unused-names_merge-blocks_all-features.txt26
-rw-r--r--test/passes/remove-unused-names_merge-blocks_all-features.wast32
-rw-r--r--test/passes/simplify-locals_all-features.txt25
-rw-r--r--test/passes/simplify-locals_all-features.wast26
-rw-r--r--test/passes/translate-to-fuzz_all-features_metrics_noprint.txt62
-rw-r--r--test/reference-types.wast246
-rw-r--r--test/reference-types.wast.from-wast404
-rw-r--r--test/reference-types.wast.fromBinary391
-rw-r--r--test/reference-types.wast.fromBinary.noDebugInfo533
-rw-r--r--test/spec/call_indirect_sig_mismatch.wast2
-rw-r--r--test/spec/exception-handling.wast44
-rw-r--r--test/unit/test_features.py10
36 files changed, 245 insertions, 2009 deletions
diff --git a/test/binaryen.js/expressions.js b/test/binaryen.js/expressions.js
index 603ca3250..a49546b91 100644
--- a/test/binaryen.js/expressions.js
+++ b/test/binaryen.js/expressions.js
@@ -1581,43 +1581,6 @@ console.log("# Rethrow");
module.dispose();
})();
-console.log("# BrOnExn");
-(function testBrOnExn() {
- const module = new binaryen.Module();
- module.addEvent("event1", 0, binaryen.none, binaryen.none);
- module.addEvent("event2", 0, binaryen.none, binaryen.none);
-
- var name = "foo";
- var event = "event1";
- var exnref = module.local.get(1, binaryen.exnref);
- const theBrOnExn = binaryen.BrOnExn(module.br_on_exn(name, event, exnref));
- assert(theBrOnExn instanceof binaryen.BrOnExn);
- assert(theBrOnExn instanceof binaryen.Expression);
- assert(theBrOnExn.name === name);
- assert(theBrOnExn.event === event);
- assert(theBrOnExn.exnref === exnref);
- assert(theBrOnExn.type === binaryen.exnref);
-
- theBrOnExn.name = name = "bar";
- assert(theBrOnExn.name === name);
- theBrOnExn.event = event = "event2";
- assert(theBrOnExn.event === event);
- theBrOnExn.exnref = exnref = module.local.get(2, binaryen.exnref);
- assert(theBrOnExn.exnref === exnref);
- theBrOnExn.type = binaryen.f64;
- theBrOnExn.finalize();
- assert(theBrOnExn.type === binaryen.exnref);
-
- console.log(theBrOnExn.toText());
- assert(
- theBrOnExn.toText()
- ==
- "(br_on_exn $bar $event2\n (local.get $2)\n)\n"
- );
-
- module.dispose();
-})();
-
console.log("# TupleMake");
(function testTupleMake() {
const module = new binaryen.Module();
diff --git a/test/binaryen.js/expressions.js.txt b/test/binaryen.js/expressions.js.txt
index d6c090d18..f5645ff1c 100644
--- a/test/binaryen.js/expressions.js.txt
+++ b/test/binaryen.js/expressions.js.txt
@@ -292,11 +292,6 @@
# Rethrow
(rethrow 1)
-# BrOnExn
-(br_on_exn $bar $event2
- (local.get $2)
-)
-
# TupleMake
(tuple.make
(i32.const 6)
diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js
index 8e7e81f26..160054fde 100644
--- a/test/binaryen.js/kitchen-sink.js
+++ b/test/binaryen.js/kitchen-sink.js
@@ -74,9 +74,6 @@ function test_types() {
console.log(" // BinaryenTypeExternref: " + binaryen.externref);
console.log(" //", binaryen.expandType(binaryen.externref).join(","));
- console.log(" // BinaryenTypeExnref: " + binaryen.exnref);
- console.log(" //", binaryen.expandType(binaryen.exnref).join(","));
-
console.log(" // BinaryenTypeAnyref: " + binaryen.anyref);
console.log(" //", binaryen.expandType(binaryen.anyref).join(","));
@@ -164,7 +161,6 @@ function test_ids() {
console.log("TryId: " + binaryen.TryId);
console.log("ThrowId: " + binaryen.ThrowId);
console.log("RethrowId: " + binaryen.RethrowId);
- console.log("BrOnExnId: " + binaryen.BrOnExnId);
console.log("TupleMakeId: " + binaryen.TupleMakeId);
console.log("TupleExtractId: " + binaryen.TupleExtractId);
console.log("I31NewId: " + binaryen.I31NewId);
@@ -591,7 +587,6 @@ function test_core() {
module.v128.pop(),
module.funcref.pop(),
module.externref.pop(),
- module.exnref.pop(),
module.anyref.pop(),
module.eqref.pop(),
module.i31ref.pop(),
@@ -642,7 +637,7 @@ function test_core() {
var body = module.block("the-body", [ nothing, makeInt32(42) ]);
// Create the function
- var sinker = module.addFunction("kitchen()sinker", iIfF, binaryen.i32, [ binaryen.i32, binaryen.exnref ], body);
+ var sinker = module.addFunction("kitchen()sinker", iIfF, binaryen.i32, [ binaryen.i32 ], body);
// Create a global
var initExpr = module.i32.const(1);
diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt
index 204dd800c..f73990493 100644
--- a/test/binaryen.js/kitchen-sink.js.txt
+++ b/test/binaryen.js/kitchen-sink.js.txt
@@ -16,14 +16,12 @@
// 7
// BinaryenTypeExternref: 8
// 8
- // BinaryenTypeExnref: 9
+ // BinaryenTypeAnyref: 9
// 9
- // BinaryenTypeAnyref: 10
+ // BinaryenTypeEqref: 10
// 10
- // BinaryenTypeEqref: 11
- // 11
- // BinaryenTypeI31ref: 13
- // 13
+ // BinaryenTypeI31ref: 12
+ // 12
// BinaryenTypeAuto: -1
// 2,2
// 2,2
@@ -88,24 +86,23 @@ RefEqId: 45
TryId: 46
ThrowId: 47
RethrowId: 48
-BrOnExnId: 49
-TupleMakeId: 50
-TupleExtractId: 51
-I31NewId: 52
-I31GetId: 53
-CallRefId: 54
-RefTestId: 55
-RefCastId: 56
-BrOnCastId: 57
-RttCanonId: 58
-RttSubId: 59
-StructNewId: 60
-StructGetId: 61
-StructSetId: 62
-ArrayNewId: 63
-ArrayGetId: 64
-ArraySetId: 65
-ArrayLenId: 66
+TupleMakeId: 49
+TupleExtractId: 50
+I31NewId: 51
+I31GetId: 52
+CallRefId: 53
+RefTestId: 54
+RefCastId: 55
+BrOnCastId: 56
+RttCanonId: 57
+RttSubId: 58
+StructNewId: 59
+StructGetId: 60
+StructSetId: 61
+ArrayNewId: 62
+ArrayGetId: 63
+ArraySetId: 64
+ArrayLenId: 65
getExpressionInfo={"id":15,"type":4,"op":6}
(f32.neg
(f32.const -33.61199951171875)
@@ -142,7 +139,6 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
(start $starter)
(func "$kitchen()sinker" (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32)
(local $4 i32)
- (local $5 exnref)
(block $the-body (result i32)
(block $the-nothing
(drop
@@ -1931,9 +1927,6 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
(pop externref)
)
(drop
- (pop exnref)
- )
- (drop
(pop anyref)
)
(drop
@@ -2005,7 +1998,6 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
(start $starter)
(func "$kitchen()sinker" (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32)
(local $4 i32)
- (local $5 exnref)
(block $the-body (result i32)
(block $the-nothing
(drop
@@ -3794,9 +3786,6 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
(pop externref)
)
(drop
- (pop exnref)
- )
- (drop
(pop anyref)
)
(drop
diff --git a/test/ctor-eval/bad-indirect-call3.wast b/test/ctor-eval/bad-indirect-call3.wast
index 7a16889ce..f1cc687b6 100644
--- a/test/ctor-eval/bad-indirect-call3.wast
+++ b/test/ctor-eval/bad-indirect-call3.wast
@@ -4,7 +4,7 @@
(data (i32.const 10) "waka waka waka waka waka")
(table funcref (elem $callee))
(export "sig_mismatch" (func $sig_mismatch))
- (func $callee (param $0 exnref)
+ (func $callee (param $0 externref)
(i32.store8 (i32.const 40) (i32.const 67))
)
(func $sig_mismatch
diff --git a/test/ctor-eval/bad-indirect-call3.wast.out b/test/ctor-eval/bad-indirect-call3.wast.out
index 28a7c5ed5..5edfb58b1 100644
--- a/test/ctor-eval/bad-indirect-call3.wast.out
+++ b/test/ctor-eval/bad-indirect-call3.wast.out
@@ -1,13 +1,13 @@
(module
(type $none_=>_none (func))
(type $funcref_=>_none (func (param funcref)))
- (type $exnref_=>_none (func (param exnref)))
+ (type $externref_=>_none (func (param externref)))
(memory $0 256 256)
(data (i32.const 10) "waka waka waka waka waka")
(table $0 1 1 funcref)
(elem (i32.const 0) $callee)
(export "sig_mismatch" (func $sig_mismatch))
- (func $callee (param $0 exnref)
+ (func $callee (param $0 externref)
(i32.store8
(i32.const 40)
(i32.const 67)
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index 58b1e00aa..d70ad11eb 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -205,12 +205,6 @@ void test_types() {
BinaryenTypeExpand(externref, &valueType);
assert(valueType == externref);
- BinaryenType exnref = BinaryenTypeExnref();
- printf(" // BinaryenTypeExnref: %d\n", exnref);
- assert(BinaryenTypeArity(exnref) == 1);
- BinaryenTypeExpand(exnref, &valueType);
- assert(valueType == exnref);
-
BinaryenType anyref = BinaryenTypeAnyref();
printf(" // BinaryenTypeAnyref: %d\n", anyref);
assert(BinaryenTypeArity(anyref) == 1);
@@ -312,7 +306,6 @@ void test_core() {
BinaryenExpressionRef funcrefExpr = BinaryenRefNull(module, BinaryenTypeFuncref());
funcrefExpr =
BinaryenRefFunc(module, "kitchen()sinker", BinaryenTypeFuncref());
- BinaryenExpressionRef exnrefExpr = BinaryenRefNull(module, BinaryenTypeExnref());
BinaryenExpressionRef i31refExpr = BinaryenI31New(module, makeInt32(module, 1));
// Events
@@ -713,7 +706,6 @@ void test_core() {
// Reference types
BinaryenRefIsNull(module, externrefExpr),
BinaryenRefIsNull(module, funcrefExpr),
- BinaryenRefIsNull(module, exnrefExpr),
BinaryenSelect(
module,
temp10,
@@ -750,7 +742,6 @@ void test_core() {
BinaryenPop(module, BinaryenTypeFloat64()),
BinaryenPop(module, BinaryenTypeFuncref()),
BinaryenPop(module, BinaryenTypeExternref()),
- BinaryenPop(module, BinaryenTypeExnref()),
BinaryenPop(module, iIfF),
// Memory
BinaryenMemorySize(module),
@@ -780,7 +771,7 @@ void test_core() {
BinaryenBlock(module, "the-body", bodyList, 2, BinaryenTypeAuto());
// Create the function
- BinaryenType localTypes[] = {BinaryenTypeInt32(), BinaryenTypeExnref()};
+ BinaryenType localTypes[] = {BinaryenTypeInt32(), BinaryenTypeExternref()};
BinaryenFunctionRef sinker = BinaryenAddFunction(
module, "kitchen()sinker", iIfF, BinaryenTypeInt32(), localTypes, 2, body);
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index 90634550b..350c5555f 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -7,10 +7,9 @@
// BinaryenTypeVec128: 6
// BinaryenTypeFuncref: 7
// BinaryenTypeExternref: 8
- // BinaryenTypeExnref: 9
- // BinaryenTypeAnyref: 10
- // BinaryenTypeEqref: 11
- // BinaryenTypeI31ref: 13
+ // BinaryenTypeAnyref: 9
+ // BinaryenTypeEqref: 10
+ // BinaryenTypeI31ref: 12
// BinaryenTypeAuto: -1
BinaryenFeatureMVP: 0
BinaryenFeatureAtomics: 1
@@ -48,7 +47,7 @@ BinaryenFeatureAll: 8191
(start $starter)
(func "$kitchen()sinker" (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32)
(local $4 i32)
- (local $5 exnref)
+ (local $5 externref)
(block $the-body (result i32)
(block $the-nothing
(drop
@@ -1748,11 +1747,6 @@ BinaryenFeatureAll: 8191
)
)
(drop
- (ref.is_null
- (ref.null exn)
- )
- )
- (drop
(select (result funcref)
(ref.null func)
(ref.func "$kitchen()sinker")
@@ -1837,9 +1831,6 @@ BinaryenFeatureAll: 8191
(pop externref)
)
(drop
- (pop exnref)
- )
- (drop
(pop i32 i64 f32 f64)
)
(drop
diff --git a/test/example/typeinfo.cpp b/test/example/typeinfo.cpp
index 729d57925..94d7c2317 100644
--- a/test/example/typeinfo.cpp
+++ b/test/example/typeinfo.cpp
@@ -25,14 +25,6 @@ void test_compound() {
assert(Type(extern_, NonNullable).getID() ==
Type(sameExtern, NonNullable).getID());
- HeapType exn(HeapType::exn);
- assert(Type(exn, Nullable).getID() == Type::exnref);
- assert(Type(exn, NonNullable).getID() == Type(exn, NonNullable).getID());
- assert(Type(exn, NonNullable).getID() != Type(exn, Nullable).getID());
- HeapType sameExn(HeapType::exn);
- assert(Type(exn, NonNullable).getID() ==
- Type(sameExn, NonNullable).getID());
-
HeapType any(HeapType::any);
assert(Type(any, Nullable).getID() == Type::anyref);
assert(Type(any, NonNullable).getID() == Type(any, NonNullable).getID());
@@ -160,9 +152,6 @@ void test_printing() {
std::cout << HeapType(HeapType::i31) << "\n";
std::cout << Type(HeapType::i31, Nullable) << "\n";
std::cout << Type(HeapType::i31, NonNullable) << "\n";
- std::cout << HeapType(HeapType::exn) << "\n";
- std::cout << Type(HeapType::exn, Nullable) << "\n";
- std::cout << Type(HeapType::exn, NonNullable) << "\n";
std::cout << HeapType(Signature(Type::none, Type::none)) << "\n";
std::cout << HeapType(Struct({})) << "\n";
std::cout << HeapType(Array({Type::i32, Immutable})) << "\n";
@@ -231,8 +220,6 @@ void test_printing() {
std::cout << Type(Rtt(3, HeapType::eq)) << "\n";
std::cout << Rtt(4, HeapType::i31) << "\n";
std::cout << Type(Rtt(4, HeapType::i31)) << "\n";
- std::cout << Rtt(5, HeapType::exn) << "\n";
- std::cout << Type(Rtt(5, HeapType::exn)) << "\n";
Rtt signatureRtt(6, Signature(Type::none, Type::none));
std::cout << signatureRtt << "\n";
std::cout << Type(signatureRtt) << "\n";
diff --git a/test/example/typeinfo.txt b/test/example/typeinfo.txt
index 4ba628925..c205ce431 100644
--- a/test/example/typeinfo.txt
+++ b/test/example/typeinfo.txt
@@ -14,9 +14,6 @@ eqref
i31
(ref null i31)
i31ref
-exn
-exnref
-(ref exn)
(func)
(struct)
(array i32)
@@ -62,8 +59,6 @@ none
(rtt 3 eq)
(rtt 4 i31)
(rtt 4 i31)
-(rtt 5 exn)
-(rtt 5 exn)
(rtt 6 (func))
(rtt 6 (func))
(rtt 7 (struct))
diff --git a/test/exception-handling.wast b/test/exception-handling.wast
index 72eb0be4a..b96c4d25f 100644
--- a/test/exception-handling.wast
+++ b/test/exception-handling.wast
@@ -3,10 +3,6 @@
(event $e-i64 (attr 0) (param i64))
(event $e-i32-i64 (attr 0) (param i32 i64))
- (func $exnref_test (param $0 exnref) (result exnref)
- (local.get $0)
- )
-
(func $foo)
(func $bar)
diff --git a/test/exception-handling.wast.from-wast b/test/exception-handling.wast.from-wast
index 64d78d54e..224df569b 100644
--- a/test/exception-handling.wast.from-wast
+++ b/test/exception-handling.wast.from-wast
@@ -3,13 +3,9 @@
(type $i32_=>_none (func (param i32)))
(type $i64_=>_none (func (param i64)))
(type $i32_i64_=>_none (func (param i32 i64)))
- (type $exnref_=>_exnref (func (param exnref) (result exnref)))
(event $e-i32 (attr 0) (param i32))
(event $e-i64 (attr 0) (param i64))
(event $e-i32-i64 (attr 0) (param i32 i64))
- (func $exnref_test (param $0 exnref) (result exnref)
- (local.get $0)
- )
(func $foo
(nop)
)
diff --git a/test/exception-handling.wast.fromBinary b/test/exception-handling.wast.fromBinary
index 292827970..d305aaaa9 100644
--- a/test/exception-handling.wast.fromBinary
+++ b/test/exception-handling.wast.fromBinary
@@ -3,13 +3,9 @@
(type $i32_=>_none (func (param i32)))
(type $i64_=>_none (func (param i64)))
(type $i32_i64_=>_none (func (param i32 i64)))
- (type $exnref_=>_exnref (func (param exnref) (result exnref)))
(event $event$0 (attr 0) (param i32))
(event $event$1 (attr 0) (param i64))
(event $event$2 (attr 0) (param i32 i64))
- (func $exnref_test (param $0 exnref) (result exnref)
- (local.get $0)
- )
(func $foo
(nop)
)
diff --git a/test/exception-handling.wast.fromBinary.noDebugInfo b/test/exception-handling.wast.fromBinary.noDebugInfo
index 1f1ebdb6f..d6dc4268e 100644
--- a/test/exception-handling.wast.fromBinary.noDebugInfo
+++ b/test/exception-handling.wast.fromBinary.noDebugInfo
@@ -3,20 +3,16 @@
(type $i32_=>_none (func (param i32)))
(type $i64_=>_none (func (param i64)))
(type $i32_i64_=>_none (func (param i32 i64)))
- (type $exnref_=>_exnref (func (param exnref) (result exnref)))
(event $event$0 (attr 0) (param i32))
(event $event$1 (attr 0) (param i64))
(event $event$2 (attr 0) (param i32 i64))
- (func $0 (param $0 exnref) (result exnref)
- (local.get $0)
+ (func $0
+ (nop)
)
(func $1
(nop)
)
(func $2
- (nop)
- )
- (func $3
(local $0 i32)
(local $1 i64)
(local $2 (i32 i64))
@@ -98,15 +94,15 @@
)
(try
(do
+ (call $0)
(call $1)
- (call $2)
)
(catch $event$0
(drop
(pop i32)
)
+ (call $0)
(call $1)
- (call $2)
)
)
(try
@@ -153,8 +149,8 @@
)
)
(catch_all
+ (call $0)
(call $1)
- (call $2)
)
)
(try
diff --git a/test/passes/code-pushing_all-features.txt b/test/passes/code-pushing_all-features.txt
index 1f975a2dd..4b3d93208 100644
--- a/test/passes/code-pushing_all-features.txt
+++ b/test/passes/code-pushing_all-features.txt
@@ -126,21 +126,4 @@
)
)
)
- (func $push-past-br-on-exn
- (local $x i32)
- (local $y exnref)
- (drop
- (block $out (result i32)
- (drop
- (br_on_exn $out $e
- (local.get $y)
- )
- )
- (local.set $x
- (i32.const 1)
- )
- (local.get $x)
- )
- )
- )
)
diff --git a/test/passes/code-pushing_all-features.wast b/test/passes/code-pushing_all-features.wast
index 0d18afcc5..0c17c0bab 100644
--- a/test/passes/code-pushing_all-features.wast
+++ b/test/passes/code-pushing_all-features.wast
@@ -85,18 +85,4 @@
(drop (local.get $x))
)
)
-
- (func $push-past-br-on-exn
- (local $x i32)
- (local $y exnref)
- (drop
- (block $out (result i32)
- (local.set $x (i32.const 1))
- (drop
- (br_on_exn $out $e (local.get $y))
- )
- (local.get $x)
- )
- )
- )
)
diff --git a/test/passes/inlining_all-features.txt b/test/passes/inlining_all-features.txt
index d16d60e7c..e23736fac 100644
--- a/test/passes/inlining_all-features.txt
+++ b/test/passes/inlining_all-features.txt
@@ -1,8 +1,6 @@
(module
(type $none_=>_none (func))
- (type $i32_=>_none (func (param i32)))
(type $none_=>_funcref (func (result funcref)))
- (event $e (attr 0) (param i32))
(export "ref_func_test" (func $ref_func_test))
(func $foo
(nop)
@@ -15,37 +13,6 @@
)
(ref.func $foo)
)
- (func $br_on_exn_name_uniquify_test
- (local $exn exnref)
- (local $1 exnref)
- (drop
- (block $l (result i32)
- (block
- (block $__inlined_func$func_inner
- (local.set $1
- (ref.null exn)
- )
- (drop
- (block $l0 (result i32)
- (drop
- (br_on_exn $l0 $e
- (local.get $1)
- )
- )
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (br_on_exn $l $e
- (local.get $exn)
- )
- )
- (i32.const 0)
- )
- )
- )
)
(module
(type $none_=>_i32 (func (result i32)))
diff --git a/test/passes/inlining_all-features.wast b/test/passes/inlining_all-features.wast
index ae9168988..863daad9b 100644
--- a/test/passes/inlining_all-features.wast
+++ b/test/passes/inlining_all-features.wast
@@ -7,34 +7,6 @@
(call $foo)
(ref.func $foo)
)
-
- ;; Tests if UniqueNameMapper works correctly for br_on_exn labels.
- ;; We have $l in br_on_exns in both $func_inner and $br_on_name_uniquify_test,
- ;; which should become unique names respectively after inlining.
- (event $e (attr 0) (param i32))
- (func $func_inner
- (local $exn exnref)
- (drop
- (block $l (result i32)
- (drop
- (br_on_exn $l $e (local.get $exn))
- )
- (i32.const 0)
- )
- )
- )
- (func $br_on_exn_name_uniquify_test
- (local $exn exnref)
- (drop
- (block $l (result i32)
- (call $func_inner)
- (drop
- (br_on_exn $l $e (local.get $exn))
- )
- (i32.const 0)
- )
- )
- )
)
(module
;; a function reference in a global's init should be noticed, and prevent us
diff --git a/test/passes/instrument-locals_all-features_disable-typed-function-references.txt b/test/passes/instrument-locals_all-features_disable-typed-function-references.txt
index f320f0421..18bd1a10d 100644
--- a/test/passes/instrument-locals_all-features_disable-typed-function-references.txt
+++ b/test/passes/instrument-locals_all-features_disable-typed-function-references.txt
@@ -6,7 +6,6 @@
(type $i32_i32_v128_=>_v128 (func (param i32 i32 v128) (result v128)))
(type $i32_i32_funcref_=>_funcref (func (param i32 i32 funcref) (result funcref)))
(type $i32_i32_externref_=>_externref (func (param i32 i32 externref) (result externref)))
- (type $i32_i32_exnref_=>_exnref (func (param i32 i32 exnref) (result exnref)))
(type $i32_i32_anyref_=>_anyref (func (param i32 i32 anyref) (result anyref)))
(type $i32_i32_eqref_=>_eqref (func (param i32 i32 eqref) (result eqref)))
(type $i32_i32_dataref_=>_dataref (func (param i32 i32 dataref) (result dataref)))
@@ -25,8 +24,6 @@
(import "env" "set_funcref" (func $set_funcref (param i32 i32 funcref) (result funcref)))
(import "env" "get_externref" (func $get_externref (param i32 i32 externref) (result externref)))
(import "env" "set_externref" (func $set_externref (param i32 i32 externref) (result externref)))
- (import "env" "get_exnref" (func $get_exnref (param i32 i32 exnref) (result exnref)))
- (import "env" "set_exnref" (func $set_exnref (param i32 i32 exnref) (result exnref)))
(import "env" "get_anyref" (func $get_anyref (param i32 i32 anyref) (result anyref)))
(import "env" "set_anyref" (func $set_anyref (param i32 i32 anyref) (result anyref)))
(import "env" "get_eqref" (func $get_eqref (param i32 i32 eqref) (result eqref)))
@@ -45,7 +42,6 @@
(local $w f64)
(local $F funcref)
(local $X externref)
- (local $E exnref)
(local $S v128)
(drop
(call $get_i32
@@ -86,15 +82,8 @@
)
)
(drop
- (call $get_exnref
- (i32.const 5)
- (i32.const 6)
- (local.get $E)
- )
- )
- (drop
(call $get_i32
- (i32.const 6)
+ (i32.const 5)
(i32.const 0)
(local.get $x)
)
@@ -104,42 +93,35 @@
)
(drop
(call $get_f32
- (i32.const 7)
+ (i32.const 6)
(i32.const 2)
(local.get $z)
)
)
(drop
(call $get_f64
- (i32.const 8)
+ (i32.const 7)
(i32.const 3)
(local.get $w)
)
)
(drop
(call $get_funcref
- (i32.const 9)
+ (i32.const 8)
(i32.const 4)
(local.get $F)
)
)
(drop
(call $get_externref
- (i32.const 10)
+ (i32.const 9)
(i32.const 5)
(local.get $X)
)
)
- (drop
- (call $get_exnref
- (i32.const 11)
- (i32.const 6)
- (local.get $E)
- )
- )
(local.set $x
(call $set_i32
- (i32.const 12)
+ (i32.const 10)
(i32.const 0)
(i32.const 1)
)
@@ -149,14 +131,14 @@
)
(local.set $z
(call $set_f32
- (i32.const 13)
+ (i32.const 11)
(i32.const 2)
(f32.const 3.2100000381469727)
)
)
(local.set $w
(call $set_f64
- (i32.const 14)
+ (i32.const 12)
(i32.const 3)
(f64.const 4.321)
)
@@ -166,29 +148,18 @@
)
(local.set $X
(call $set_externref
- (i32.const 16)
+ (i32.const 14)
(i32.const 5)
(call $get_externref
- (i32.const 15)
+ (i32.const 13)
(i32.const 5)
(local.get $X)
)
)
)
- (local.set $E
- (call $set_exnref
- (i32.const 18)
- (i32.const 6)
- (call $get_exnref
- (i32.const 17)
- (i32.const 6)
- (local.get $E)
- )
- )
- )
(local.set $x
(call $set_i32
- (i32.const 19)
+ (i32.const 15)
(i32.const 0)
(i32.const 11)
)
@@ -198,24 +169,24 @@
)
(local.set $z
(call $set_f32
- (i32.const 20)
+ (i32.const 16)
(i32.const 2)
(f32.const 33.209999084472656)
)
)
(local.set $w
(call $set_f64
- (i32.const 21)
+ (i32.const 17)
(i32.const 3)
(f64.const 44.321)
)
)
(local.set $F
(call $set_funcref
- (i32.const 23)
+ (i32.const 19)
(i32.const 4)
(call $get_funcref
- (i32.const 22)
+ (i32.const 18)
(i32.const 4)
(local.get $F)
)
@@ -223,26 +194,15 @@
)
(local.set $X
(call $set_externref
- (i32.const 25)
+ (i32.const 21)
(i32.const 5)
(call $get_externref
- (i32.const 24)
+ (i32.const 20)
(i32.const 5)
(local.get $X)
)
)
)
- (local.set $E
- (call $set_exnref
- (i32.const 27)
- (i32.const 6)
- (call $get_exnref
- (i32.const 26)
- (i32.const 6)
- (local.get $E)
- )
- )
- )
(try
(do
(nop)
@@ -255,15 +215,15 @@
)
(drop
(call $get_v128
- (i32.const 28)
- (i32.const 7)
+ (i32.const 22)
+ (i32.const 6)
(local.get $S)
)
)
(local.set $S
(call $set_v128
- (i32.const 29)
- (i32.const 7)
+ (i32.const 23)
+ (i32.const 6)
(v128.const i32x4 0x00000000 0x00000001 0x00000002 0x00000003)
)
)
diff --git a/test/passes/instrument-locals_all-features_disable-typed-function-references.wast b/test/passes/instrument-locals_all-features_disable-typed-function-references.wast
index 53b2349fa..29de7964e 100644
--- a/test/passes/instrument-locals_all-features_disable-typed-function-references.wast
+++ b/test/passes/instrument-locals_all-features_disable-typed-function-references.wast
@@ -8,7 +8,6 @@
(local $w f64)
(local $F funcref)
(local $X externref)
- (local $E exnref)
(local $S v128)
(drop (local.get $x))
@@ -17,7 +16,6 @@
(drop (local.get $w))
(drop (local.get $F))
(drop (local.get $X))
- (drop (local.get $E))
(drop (local.get $x))
(drop (local.get $y))
@@ -25,7 +23,6 @@
(drop (local.get $w))
(drop (local.get $F))
(drop (local.get $X))
- (drop (local.get $E))
(local.set $x (i32.const 1))
(local.set $y (i64.const 2))
@@ -33,7 +30,6 @@
(local.set $w (f64.const 4.321))
(local.set $F (ref.func $test))
(local.set $X (local.get $X))
- (local.set $E (local.get $E))
(local.set $x (i32.const 11))
(local.set $y (i64.const 22))
@@ -41,7 +37,6 @@
(local.set $w (f64.const 44.321))
(local.set $F (local.get $F))
(local.set $X (local.get $X))
- (local.set $E (local.get $E))
;; Pop instructions should not be instrumented
(try
diff --git a/test/passes/precompute_all-features.txt b/test/passes/precompute_all-features.txt
index 68d7dce15..c22711cb9 100644
--- a/test/passes/precompute_all-features.txt
+++ b/test/passes/precompute_all-features.txt
@@ -10,7 +10,6 @@
(data (i32.const 0) "passive")
(global $global i32 (i32.const 1))
(global $global-mut (mut i32) (i32.const 2))
- (event $event$0 (attr 0) (param))
(func $x (param $x i32)
(call $x
(i32.const 2300)
@@ -315,13 +314,4 @@
)
)
)
- (func $unreachable-br_on_exn
- (block $label$1
- (drop
- (loop $label$2
- (br $label$2)
- )
- )
- )
- )
)
diff --git a/test/passes/precompute_all-features.wast b/test/passes/precompute_all-features.wast
index ca849b88c..589a8acf5 100644
--- a/test/passes/precompute_all-features.wast
+++ b/test/passes/precompute_all-features.wast
@@ -461,19 +461,4 @@
)
)
)
-
- ;; br_on_exn's argument becomes unreachable, so br_on_exn itself is replaced
- ;; with its argument in ReFinalize process after precompute.
- (event $event$0 (attr 0) (param))
- (func $unreachable-br_on_exn
- (block $label$1
- (drop
- (br_on_exn $label$1 $event$0
- (loop $label$2 (result exnref)
- (br $label$2)
- )
- )
- )
- )
- )
)
diff --git a/test/passes/remove-unused-names_code-folding_all-features.txt b/test/passes/remove-unused-names_code-folding_all-features.txt
index 2f78a83e7..792427112 100644
--- a/test/passes/remove-unused-names_code-folding_all-features.txt
+++ b/test/passes/remove-unused-names_code-folding_all-features.txt
@@ -5,7 +5,6 @@
(type $i32_=>_i32 (func (param i32) (result i32)))
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
(event $e-i32 (attr 0) (param i32))
- (event $e (attr 0) (param))
(func $ifs
(if
(i32.const 0)
@@ -1747,47 +1746,6 @@
)
(unreachable)
)
- (func $br_on_exn-target-block
- (local $exn exnref)
- (block $x
- (if
- (i32.const 0)
- (block
- (drop
- (i32.const 1)
- )
- (drop
- (i32.const 2)
- )
- (br $x)
- )
- )
- (if
- (i32.const 0)
- (block
- (drop
- (i32.const 1)
- )
- (drop
- (i32.const 2)
- )
- (br $x)
- )
- )
- (drop
- (br_on_exn $x $e
- (local.get $exn)
- )
- )
- (drop
- (i32.const 1)
- )
- (drop
- (i32.const 2)
- )
- (br $x)
- )
- )
(func $foo
(nop)
)
diff --git a/test/passes/remove-unused-names_code-folding_all-features.wast b/test/passes/remove-unused-names_code-folding_all-features.wast
index 387b8600b..320e820d8 100644
--- a/test/passes/remove-unused-names_code-folding_all-features.wast
+++ b/test/passes/remove-unused-names_code-folding_all-features.wast
@@ -1218,33 +1218,6 @@
)
)
- (event $e (attr 0)) ;; exception with no param
- (func $br_on_exn-target-block (local $exn exnref)
- ;; Here this block $x is targeted by br_on_exn, so code folding out of this
- ;; block should NOT happen.
- (block $x
- (if (i32.const 0)
- (block
- (drop (i32.const 1))
- (drop (i32.const 2))
- (br $x)
- )
- )
- (if (i32.const 0)
- (block
- (drop (i32.const 1))
- (drop (i32.const 2))
- (br $x)
- )
- )
- (drop (br_on_exn $x $e (local.get $exn)))
- ;; no fallthrough, another thing to merge
- (drop (i32.const 1))
- (drop (i32.const 2))
- (br $x)
- )
- )
-
(func $foo)
(func $try-call-optimize-terminating-tails (result i32)
(try
diff --git a/test/passes/remove-unused-names_merge-blocks_all-features.txt b/test/passes/remove-unused-names_merge-blocks_all-features.txt
index 46d45d3fe..4efda13ca 100644
--- a/test/passes/remove-unused-names_merge-blocks_all-features.txt
+++ b/test/passes/remove-unused-names_merge-blocks_all-features.txt
@@ -1700,7 +1700,6 @@
(module
(type $none_=>_none (func))
(type $i32_=>_none (func (param i32)))
- (type $none_=>_i32 (func (result i32)))
(event $e (attr 0) (param i32))
(func $foo
(nop)
@@ -1711,29 +1710,4 @@
(i32.const 3)
)
)
- (func $br_on_exn (result i32)
- (local $0 exnref)
- (block $label$0 (result i32)
- (call $foo)
- (drop
- (br_on_exn $label$0 $e
- (local.get $0)
- )
- )
- (i32.const 3)
- )
- )
- (func $cannot_extract_br_on_exn_exnref
- (local $0 exnref)
- (drop
- (block $label$0 (result i32)
- (drop
- (br_on_exn $label$0 $e
- (local.get $0)
- )
- )
- (i32.const 5)
- )
- )
- )
)
diff --git a/test/passes/remove-unused-names_merge-blocks_all-features.wast b/test/passes/remove-unused-names_merge-blocks_all-features.wast
index 6869db6ad..8e0145900 100644
--- a/test/passes/remove-unused-names_merge-blocks_all-features.wast
+++ b/test/passes/remove-unused-names_merge-blocks_all-features.wast
@@ -1570,36 +1570,4 @@
)
)
)
-
- ;; 'call $foo' within 'block' of `br_on_exn' can be hoisted
- (func $br_on_exn (result i32) (local $0 exnref)
- (block $label$0 (result i32)
- (drop
- (br_on_exn $label$0 $e
- (block (result exnref)
- (call $foo)
- (local.get $0)
- )
- )
- )
- (i32.const 3)
- )
- )
-
- ;; Unlike br_if, br_on_exn's exnref argument itself cannot be extracted.
- ;; Without proper handling for br_on_exn in ProblemFinder, this crashes.
- (func $cannot_extract_br_on_exn_exnref (local $0 exnref)
- (block
- (drop
- (block $label$0 (result i32)
- (drop
- (br_on_exn $label$0 $e
- (local.get $0)
- )
- )
- (i32.const 5)
- )
- )
- )
- )
)
diff --git a/test/passes/simplify-locals_all-features.txt b/test/passes/simplify-locals_all-features.txt
index 2604ad88d..34c13d442 100644
--- a/test/passes/simplify-locals_all-features.txt
+++ b/test/passes/simplify-locals_all-features.txt
@@ -1897,34 +1897,9 @@
(module
(type $none_=>_none (func))
(type $i32_=>_none (func (param i32)))
- (type $exnref_=>_none (func (param exnref)))
(type $i32_i32_=>_none (func (param i32 i32)))
(type $none_=>_i32 (func (result i32)))
- (type $none_=>_exnref (func (result exnref)))
- (event $event$0 (attr 0) (param))
- (event $event$1 (attr 0) (param exnref))
(event $e-i32 (attr 0) (param i32))
- (func $unoptimizable-br_on_exn-block (result exnref)
- (local $0 exnref)
- (block $label$0
- (local.set $0
- (br_on_exn $label$0 $event$0
- (ref.null exn)
- )
- )
- )
- (local.get $0)
- )
- (func $br_on_exn-trap
- (local $0 exnref)
- (drop
- (block $label$1 (result exnref)
- (br_on_exn $label$1 $event$1
- (ref.null exn)
- )
- )
- )
- )
(func $foo (param $0 i32) (param $1 i32)
(nop)
)
diff --git a/test/passes/simplify-locals_all-features.wast b/test/passes/simplify-locals_all-features.wast
index 13ff13679..2c54cdec3 100644
--- a/test/passes/simplify-locals_all-features.wast
+++ b/test/passes/simplify-locals_all-features.wast
@@ -1672,32 +1672,6 @@
)
)
(module
- (event $event$0 (attr 0) (param))
- (func $unoptimizable-br_on_exn-block (result exnref) (local $0 exnref)
- (block $label$0
- (local.set $0
- ;; br_on_exn's target block cannot be optimized to have a return value
- (br_on_exn $label$0 $event$0
- (ref.null exn)
- )
- )
- )
- (local.get $0)
- )
-
- (event $event$1 (attr 0) (param exnref))
- (func $br_on_exn-trap (local $0 exnref)
- ;; This dead local.set cannot be replaced with a nop because br_on_exn can
- ;; trap.
- (local.set $0
- (block $label$1 (result exnref)
- (br_on_exn $label$1 $event$1
- (ref.null exn)
- )
- )
- )
- )
-
(event $e-i32 (attr 0) (param i32))
(func $foo (param i32 i32))
(func $pop-cannot-be-sinked (local $0 i32)
diff --git a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt
index 0a21ed52b..c11b58362 100644
--- a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt
+++ b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt
@@ -1,42 +1,38 @@
total
[events] : 1
- [exports] : 3
- [funcs] : 2
+ [exports] : 7
+ [funcs] : 8
[globals] : 6
- [imports] : 6
+ [imports] : 5
[memory-data] : 22
- [table-data] : 0
- [total] : 592
- [vars] : 1
- atomic.cmpxchg : 1
- atomic.fence : 3
- binary : 58
- block : 84
- break : 26
- call : 4
+ [table-data] : 1
+ [total] : 461
+ [vars] : 11
+ atomic.rmw : 1
+ binary : 72
+ block : 40
+ break : 5
+ call : 13
call_ref : 1
- const : 149
- data.drop : 1
+ const : 124
drop : 3
- global.get : 29
- global.set : 17
- i31.get : 2
- i31.new : 7
- if : 35
- load : 15
- local.get : 10
- local.set : 14
- loop : 13
+ global.get : 20
+ global.set : 11
+ i31.get : 1
+ i31.new : 8
+ if : 17
+ load : 19
+ local.get : 34
+ local.set : 18
+ loop : 4
memory.init : 1
- nop : 36
- ref.eq : 2
- ref.func : 2
- ref.is_null : 3
- ref.null : 8
+ nop : 8
+ ref.func : 1
+ ref.null : 11
return : 14
- select : 2
+ select : 1
simd_extract : 2
- store : 8
- tuple.extract : 5
- tuple.make : 4
- unary : 33
+ store : 3
+ tuple.extract : 1
+ tuple.make : 8
+ unary : 20
diff --git a/test/reference-types.wast b/test/reference-types.wast
index bd19aa5c5..e79508839 100644
--- a/test/reference-types.wast
+++ b/test/reference-types.wast
@@ -1,4 +1,4 @@
-;; reftype :: externref | funcref | exnref
+;; reftype :: externref | funcref
;; NOTE: the subtyping relationship has been removed from the reference-types proposal but an
;; `--enable-anyref` feature flag is present in Binaryen that we use below to test subtyping.
@@ -9,16 +9,14 @@
(module
(type $sig_externref (func (param externref)))
(type $sig_funcref (func (param funcref)))
- (type $sig_exnref (func (param exnref)))
(type $sig_anyref (func (param anyref)))
(func $take_externref (param externref))
(func $take_funcref (param funcref))
- (func $take_exnref (param exnref))
(func $take_anyref (param anyref))
(func $foo)
- (table funcref (elem $take_externref $take_funcref $take_exnref $take_anyref))
+ (table funcref (elem $take_externref $take_funcref $take_anyref))
(import "env" "import_func" (func $import_func (param externref) (result funcref)))
(import "env" "import_global" (global $import_global externref))
@@ -29,21 +27,18 @@
(global $global_externref (mut externref) (ref.null extern))
(global $global_funcref (mut funcref) (ref.null func))
(global $global_funcref_func (mut funcref) (ref.func $foo))
- (global $global_exnref (mut exnref) (ref.null exn))
(global $global_anyref (mut anyref) (ref.null any))
;; Test subtype relationship in global initializer expressions
(global $global_anyref2 (mut anyref) (ref.null extern))
(global $global_anyref3 (mut anyref) (ref.null func))
(global $global_anyref4 (mut anyref) (ref.func $foo))
- (global $global_anyref5 (mut anyref) (ref.null exn))
(event $e-i32 (attr 0) (param i32))
(func $test
(local $local_externref externref)
(local $local_funcref funcref)
- (local $local_exnref exnref)
(local $local_anyref anyref)
;; Test types for local.get/set
@@ -54,9 +49,6 @@
(local.set $local_funcref (global.get $global_funcref))
(local.set $local_funcref (ref.null func))
(local.set $local_funcref (ref.func $foo))
- (local.set $local_exnref (local.get $local_exnref))
- (local.set $local_exnref (global.get $global_exnref))
- (local.set $local_exnref (ref.null exn))
(local.set $local_anyref (local.get $local_anyref))
(local.set $local_anyref (global.get $global_anyref))
(local.set $local_anyref (ref.null any))
@@ -69,9 +61,6 @@
(local.set $local_anyref (global.get $global_funcref))
(local.set $local_anyref (ref.null func))
(local.set $local_anyref (ref.func $foo))
- (local.set $local_anyref (local.get $local_exnref))
- (local.set $local_anyref (global.get $global_exnref))
- (local.set $local_anyref (ref.null exn))
;; Test types for global.get/set
(global.set $global_externref (global.get $global_externref))
@@ -81,9 +70,6 @@
(global.set $global_funcref (local.get $local_funcref))
(global.set $global_funcref (ref.null func))
(global.set $global_funcref (ref.func $foo))
- (global.set $global_exnref (global.get $global_exnref))
- (global.set $global_exnref (local.get $local_exnref))
- (global.set $global_exnref (ref.null exn))
(global.set $global_anyref (global.get $global_anyref))
(global.set $global_anyref (local.get $local_anyref))
(global.set $global_anyref (ref.null any))
@@ -96,9 +82,6 @@
(global.set $global_anyref (local.get $local_funcref))
(global.set $global_anyref (ref.null func))
(global.set $global_anyref (ref.func $foo))
- (global.set $global_anyref (global.get $global_exnref))
- (global.set $global_anyref (local.get $local_exnref))
- (global.set $global_anyref (ref.null exn))
;; Test function call params
(call $take_externref (local.get $local_externref))
@@ -108,9 +91,6 @@
(call $take_funcref (global.get $global_funcref))
(call $take_funcref (ref.null func))
(call $take_funcref (ref.func $foo))
- (call $take_exnref (local.get $local_exnref))
- (call $take_exnref (global.get $global_exnref))
- (call $take_exnref (ref.null exn))
(call $take_anyref (local.get $local_anyref))
(call $take_anyref (global.get $global_anyref))
(call $take_anyref (ref.null any))
@@ -123,9 +103,6 @@
(call $take_anyref (global.get $global_funcref))
(call $take_anyref (ref.null func))
(call $take_anyref (ref.func $foo))
- (call $take_anyref (local.get $local_exnref))
- (call $take_anyref (global.get $global_exnref))
- (call $take_anyref (ref.null exn))
;; Test call_indirect params
(call_indirect (type $sig_externref) (local.get $local_externref) (i32.const 0))
@@ -135,9 +112,6 @@
(call_indirect (type $sig_funcref) (global.get $global_funcref) (i32.const 1))
(call_indirect (type $sig_funcref) (ref.null func) (i32.const 1))
(call_indirect (type $sig_funcref) (ref.func $foo) (i32.const 1))
- (call_indirect (type $sig_exnref) (local.get $local_exnref) (i32.const 2))
- (call_indirect (type $sig_exnref) (global.get $global_exnref) (i32.const 2))
- (call_indirect (type $sig_exnref) (ref.null exn) (i32.const 2))
(call_indirect (type $sig_anyref) (local.get $local_anyref) (i32.const 3))
(call_indirect (type $sig_anyref) (global.get $global_anyref) (i32.const 3))
(call_indirect (type $sig_anyref) (ref.null any) (i32.const 3))
@@ -150,9 +124,6 @@
(call_indirect (type $sig_anyref) (global.get $global_funcref) (i32.const 3))
(call_indirect (type $sig_anyref) (ref.null func) (i32.const 3))
(call_indirect (type $sig_anyref) (ref.func $foo) (i32.const 3))
- (call_indirect (type $sig_anyref) (local.get $local_exnref) (i32.const 3))
- (call_indirect (type $sig_anyref) (global.get $global_exnref) (i32.const 3))
- (call_indirect (type $sig_anyref) (ref.null exn) (i32.const 3))
;; Test block return type
(drop
@@ -191,21 +162,6 @@
)
)
(drop
- (block (result exnref)
- (br_if 0 (local.get $local_exnref) (i32.const 1))
- )
- )
- (drop
- (block (result exnref)
- (br_if 0 (global.get $global_exnref) (i32.const 1))
- )
- )
- (drop
- (block (result exnref)
- (br_if 0 (ref.null exn) (i32.const 1))
- )
- )
- (drop
(block (result anyref)
(br_if 0 (local.get $local_anyref) (i32.const 1))
)
@@ -234,11 +190,6 @@
)
(drop
(block (result anyref)
- (br_if 0 (local.get $local_exnref) (i32.const 1))
- )
- )
- (drop
- (block (result anyref)
(br_if 0 (ref.null extern) (i32.const 1))
)
)
@@ -252,11 +203,6 @@
(br_if 0 (ref.func $foo) (i32.const 1))
)
)
- (drop
- (block (result anyref)
- (br_if 0 (ref.null exn) (i32.const 1))
- )
- )
;; Test loop return type
(drop
@@ -295,21 +241,6 @@
)
)
(drop
- (loop (result exnref)
- (local.get $local_exnref)
- )
- )
- (drop
- (loop (result exnref)
- (global.get $global_exnref)
- )
- )
- (drop
- (loop (result exnref)
- (ref.null exn)
- )
- )
- (drop
(loop (result anyref)
(local.get $local_anyref)
)
@@ -361,21 +292,6 @@
(ref.func $foo)
)
)
- (drop
- (loop (result anyref)
- (local.get $local_exnref)
- )
- )
- (drop
- (loop (result anyref)
- (global.get $global_exnref)
- )
- )
- (drop
- (loop (result anyref)
- (ref.null exn)
- )
- )
;; Test if return type
(drop
@@ -393,13 +309,6 @@
)
)
(drop
- (if (result exnref)
- (i32.const 1)
- (local.get $local_exnref)
- (ref.null exn)
- )
- )
- (drop
(if (result anyref)
(i32.const 1)
(local.get $local_anyref)
@@ -418,20 +327,6 @@
(drop
(if (result anyref)
(i32.const 1)
- (local.get $local_externref)
- (local.get $local_exnref)
- )
- )
- (drop
- (if (result anyref)
- (i32.const 1)
- (local.get $local_funcref)
- (local.get $local_exnref)
- )
- )
- (drop
- (if (result anyref)
- (i32.const 1)
(ref.null extern)
(ref.null func)
)
@@ -439,20 +334,6 @@
(drop
(if (result anyref)
(i32.const 1)
- (ref.null extern)
- (ref.null exn)
- )
- )
- (drop
- (if (result anyref)
- (i32.const 1)
- (ref.null func)
- (ref.null exn)
- )
- )
- (drop
- (if (result anyref)
- (i32.const 1)
(ref.func $foo)
(ref.null extern)
)
@@ -481,17 +362,6 @@
)
)
)
- (drop
- (try (result exnref)
- (do
- (ref.null exn)
- )
- (catch $e-i32
- (drop (pop i32))
- (ref.null exn)
- )
- )
- )
;; Test subtype relationship for try return type
(drop
@@ -508,17 +378,6 @@
(drop
(try (result anyref)
(do
- (local.get $local_externref)
- )
- (catch $e-i32
- (drop (pop i32))
- (local.get $local_exnref)
- )
- )
- )
- (drop
- (try (result anyref)
- (do
(ref.func $foo)
)
(catch $e-i32
@@ -527,39 +386,6 @@
)
)
)
- (drop
- (try (result anyref)
- (do
- (ref.func $foo)
- )
- (catch $e-i32
- (drop (pop i32))
- (local.get $local_exnref)
- )
- )
- )
- (drop
- (try (result anyref)
- (do
- (ref.null exn)
- )
- (catch $e-i32
- (drop (pop i32))
- (local.get $local_externref)
- )
- )
- )
- (drop
- (try (result anyref)
- (do
- (ref.null exn)
- )
- (catch $e-i32
- (drop (pop i32))
- (ref.func $foo)
- )
- )
- )
;; Test typed select
(drop
@@ -577,13 +403,6 @@
)
)
(drop
- (select (result exnref)
- (local.get $local_exnref)
- (ref.null exn)
- (i32.const 1)
- )
- )
- (drop
(select (result i32)
(i32.const 0)
(i32.const 2)
@@ -601,39 +420,11 @@
)
(drop
(select (result anyref)
- (local.get $local_externref)
- (local.get $local_exnref)
- (i32.const 1)
- )
- )
- (drop
- (select (result anyref)
(local.get $local_funcref)
(local.get $local_externref)
(i32.const 1)
)
)
- (drop
- (select (result anyref)
- (local.get $local_funcref)
- (local.get $local_exnref)
- (i32.const 1)
- )
- )
- (drop
- (select (result anyref)
- (local.get $local_exnref)
- (local.get $local_externref)
- (i32.const 1)
- )
- )
- (drop
- (select (result anyref)
- (local.get $local_exnref)
- (local.get $local_funcref)
- (i32.const 1)
- )
- )
;; ref.is_null takes any reference types
(drop (ref.is_null (local.get $local_externref)))
@@ -643,9 +434,6 @@
(drop (ref.is_null (global.get $global_funcref)))
(drop (ref.is_null (ref.null func)))
(drop (ref.is_null (ref.func $foo)))
- (drop (ref.is_null (local.get $local_exnref)))
- (drop (ref.is_null (global.get $global_exnref)))
- (drop (ref.is_null (ref.null exn)))
(drop (ref.is_null (local.get $local_anyref)))
(drop (ref.is_null (global.get $global_anyref)))
(drop (ref.is_null (ref.null any)))
@@ -675,16 +463,6 @@
(func $return_funcref_func (result funcref)
(ref.func $foo)
)
- (func $return_exnref_local (result exnref)
- (local $local_exnref exnref)
- (local.get $local_exnref)
- )
- (func $return_exnref_global (result exnref)
- (global.get $global_exnref)
- )
- (func $return_exnref_null (result exnref)
- (ref.null exn)
- )
(func $return_anyref_local (result anyref)
(local $local_anyref anyref)
(local.get $local_anyref)
@@ -720,16 +498,6 @@
(func $return_anyref8 (result anyref)
(ref.func $foo)
)
- (func $return_anyref9 (result anyref)
- (local $local_exnref exnref)
- (local.get $local_exnref)
- )
- (func $return_anyref10 (result anyref)
- (global.get $global_exnref)
- )
- (func $return_anyref11 (result anyref)
- (ref.null exn)
- )
;; Test returns
(func $returns_externref (result externref)
@@ -745,12 +513,6 @@
(return (ref.func $foo))
(return (ref.null func))
)
- (func $returns_exnref (result exnref)
- (local $local_exnref exnref)
- (return (local.get $local_exnref))
- (return (global.get $global_exnref))
- (return (ref.null exn))
- )
(func $returns_anyref (result anyref)
(local $local_anyref anyref)
(return (local.get $local_anyref))
@@ -762,7 +524,6 @@
(func $returns_anyref2 (result anyref)
(local $local_externref externref)
(local $local_funcref funcref)
- (local $local_exnref exnref)
(return (local.get $local_externref))
(return (global.get $global_externref))
(return (ref.null extern))
@@ -770,8 +531,5 @@
(return (global.get $global_funcref))
(return (ref.func $foo))
(return (ref.null func))
- (return (local.get $local_exnref))
- (return (global.get $global_exnref))
- (return (ref.null exn))
)
)
diff --git a/test/reference-types.wast.from-wast b/test/reference-types.wast.from-wast
index 9deee6a15..3d8e70c23 100644
--- a/test/reference-types.wast.from-wast
+++ b/test/reference-types.wast.from-wast
@@ -4,25 +4,21 @@
(type $funcref_=>_none (func (param funcref)))
(type $none_=>_funcref (func (result funcref)))
(type $externref_=>_none (func (param externref)))
- (type $exnref_=>_none (func (param exnref)))
(type $none_=>_externref (func (result externref)))
- (type $none_=>_exnref (func (result exnref)))
(type $none_=>_none (func))
(type $i32_=>_none (func (param i32)))
(type $externref_=>_funcref (func (param externref) (result funcref)))
(import "env" "import_global" (global $import_global externref))
(import "env" "import_func" (func $import_func (param externref) (result funcref)))
- (table $0 4 4 funcref)
- (elem (i32.const 0) $take_externref $take_funcref $take_exnref $take_anyref)
+ (table $0 3 3 funcref)
+ (elem (i32.const 0) $take_externref $take_funcref $take_anyref)
(global $global_externref (mut externref) (ref.null extern))
(global $global_funcref (mut funcref) (ref.null func))
(global $global_funcref_func (mut funcref) (ref.func $foo))
- (global $global_exnref (mut exnref) (ref.null exn))
(global $global_anyref (mut anyref) (ref.null any))
(global $global_anyref2 (mut anyref) (ref.null extern))
(global $global_anyref3 (mut anyref) (ref.null func))
(global $global_anyref4 (mut anyref) (ref.func $foo))
- (global $global_anyref5 (mut anyref) (ref.null exn))
(event $e-i32 (attr 0) (param i32))
(export "export_func" (func $import_func))
(export "export_global" (global $import_global))
@@ -32,9 +28,6 @@
(func $take_funcref (param $0 funcref)
(nop)
)
- (func $take_exnref (param $0 exnref)
- (nop)
- )
(func $take_anyref (param $0 anyref)
(nop)
)
@@ -44,7 +37,6 @@
(func $test
(local $local_externref externref)
(local $local_funcref funcref)
- (local $local_exnref exnref)
(local $local_anyref anyref)
(local.set $local_externref
(local.get $local_externref)
@@ -67,15 +59,6 @@
(local.set $local_funcref
(ref.func $foo)
)
- (local.set $local_exnref
- (local.get $local_exnref)
- )
- (local.set $local_exnref
- (global.get $global_exnref)
- )
- (local.set $local_exnref
- (ref.null exn)
- )
(local.set $local_anyref
(local.get $local_anyref)
)
@@ -106,15 +89,6 @@
(local.set $local_anyref
(ref.func $foo)
)
- (local.set $local_anyref
- (local.get $local_exnref)
- )
- (local.set $local_anyref
- (global.get $global_exnref)
- )
- (local.set $local_anyref
- (ref.null exn)
- )
(global.set $global_externref
(global.get $global_externref)
)
@@ -136,15 +110,6 @@
(global.set $global_funcref
(ref.func $foo)
)
- (global.set $global_exnref
- (global.get $global_exnref)
- )
- (global.set $global_exnref
- (local.get $local_exnref)
- )
- (global.set $global_exnref
- (ref.null exn)
- )
(global.set $global_anyref
(global.get $global_anyref)
)
@@ -175,15 +140,6 @@
(global.set $global_anyref
(ref.func $foo)
)
- (global.set $global_anyref
- (global.get $global_exnref)
- )
- (global.set $global_anyref
- (local.get $local_exnref)
- )
- (global.set $global_anyref
- (ref.null exn)
- )
(call $take_externref
(local.get $local_externref)
)
@@ -205,15 +161,6 @@
(call $take_funcref
(ref.func $foo)
)
- (call $take_exnref
- (local.get $local_exnref)
- )
- (call $take_exnref
- (global.get $global_exnref)
- )
- (call $take_exnref
- (ref.null exn)
- )
(call $take_anyref
(local.get $local_anyref)
)
@@ -244,15 +191,6 @@
(call $take_anyref
(ref.func $foo)
)
- (call $take_anyref
- (local.get $local_exnref)
- )
- (call $take_anyref
- (global.get $global_exnref)
- )
- (call $take_anyref
- (ref.null exn)
- )
(call_indirect (type $externref_=>_none)
(local.get $local_externref)
(i32.const 0)
@@ -281,18 +219,6 @@
(ref.func $foo)
(i32.const 1)
)
- (call_indirect (type $exnref_=>_none)
- (local.get $local_exnref)
- (i32.const 2)
- )
- (call_indirect (type $exnref_=>_none)
- (global.get $global_exnref)
- (i32.const 2)
- )
- (call_indirect (type $exnref_=>_none)
- (ref.null exn)
- (i32.const 2)
- )
(call_indirect (type $anyref_=>_none)
(local.get $local_anyref)
(i32.const 3)
@@ -333,18 +259,6 @@
(ref.func $foo)
(i32.const 3)
)
- (call_indirect (type $anyref_=>_none)
- (local.get $local_exnref)
- (i32.const 3)
- )
- (call_indirect (type $anyref_=>_none)
- (global.get $global_exnref)
- (i32.const 3)
- )
- (call_indirect (type $anyref_=>_none)
- (ref.null exn)
- (i32.const 3)
- )
(drop
(block $block (result externref)
(br_if $block
@@ -402,25 +316,25 @@
)
)
(drop
- (block $block6 (result exnref)
+ (block $block6 (result anyref)
(br_if $block6
- (local.get $local_exnref)
+ (local.get $local_anyref)
(i32.const 1)
)
)
)
(drop
- (block $block7 (result exnref)
+ (block $block7 (result anyref)
(br_if $block7
- (global.get $global_exnref)
+ (global.get $global_anyref)
(i32.const 1)
)
)
)
(drop
- (block $block8 (result exnref)
+ (block $block8 (result anyref)
(br_if $block8
- (ref.null exn)
+ (ref.null any)
(i32.const 1)
)
)
@@ -428,7 +342,7 @@
(drop
(block $block9 (result anyref)
(br_if $block9
- (local.get $local_anyref)
+ (local.get $local_externref)
(i32.const 1)
)
)
@@ -436,7 +350,7 @@
(drop
(block $block10 (result anyref)
(br_if $block10
- (global.get $global_anyref)
+ (local.get $local_funcref)
(i32.const 1)
)
)
@@ -444,7 +358,7 @@
(drop
(block $block11 (result anyref)
(br_if $block11
- (ref.null any)
+ (ref.null extern)
(i32.const 1)
)
)
@@ -452,7 +366,7 @@
(drop
(block $block12 (result anyref)
(br_if $block12
- (local.get $local_externref)
+ (ref.null func)
(i32.const 1)
)
)
@@ -460,167 +374,97 @@
(drop
(block $block13 (result anyref)
(br_if $block13
- (local.get $local_funcref)
- (i32.const 1)
- )
- )
- )
- (drop
- (block $block14 (result anyref)
- (br_if $block14
- (local.get $local_exnref)
- (i32.const 1)
- )
- )
- )
- (drop
- (block $block15 (result anyref)
- (br_if $block15
- (ref.null extern)
- (i32.const 1)
- )
- )
- )
- (drop
- (block $block16 (result anyref)
- (br_if $block16
- (ref.null func)
- (i32.const 1)
- )
- )
- )
- (drop
- (block $block17 (result anyref)
- (br_if $block17
(ref.func $foo)
(i32.const 1)
)
)
)
(drop
- (block $block18 (result anyref)
- (br_if $block18
- (ref.null exn)
- (i32.const 1)
- )
- )
- )
- (drop
(loop $loop-in (result externref)
(local.get $local_externref)
)
)
(drop
- (loop $loop-in19 (result externref)
+ (loop $loop-in14 (result externref)
(global.get $global_externref)
)
)
(drop
- (loop $loop-in20 (result externref)
+ (loop $loop-in15 (result externref)
(ref.null extern)
)
)
(drop
- (loop $loop-in21 (result funcref)
+ (loop $loop-in16 (result funcref)
(local.get $local_funcref)
)
)
(drop
- (loop $loop-in22 (result funcref)
+ (loop $loop-in17 (result funcref)
(global.get $global_funcref)
)
)
(drop
- (loop $loop-in23 (result funcref)
+ (loop $loop-in18 (result funcref)
(ref.null func)
)
)
(drop
- (loop $loop-in24 (result funcref)
+ (loop $loop-in19 (result funcref)
(ref.func $foo)
)
)
(drop
- (loop $loop-in25 (result exnref)
- (local.get $local_exnref)
- )
- )
- (drop
- (loop $loop-in26 (result exnref)
- (global.get $global_exnref)
- )
- )
- (drop
- (loop $loop-in27 (result exnref)
- (ref.null exn)
- )
- )
- (drop
- (loop $loop-in28 (result anyref)
+ (loop $loop-in20 (result anyref)
(local.get $local_anyref)
)
)
(drop
- (loop $loop-in29 (result anyref)
+ (loop $loop-in21 (result anyref)
(global.get $global_anyref)
)
)
(drop
- (loop $loop-in30 (result anyref)
+ (loop $loop-in22 (result anyref)
(ref.null any)
)
)
(drop
- (loop $loop-in31 (result anyref)
+ (loop $loop-in23 (result anyref)
(local.get $local_externref)
)
)
(drop
- (loop $loop-in32 (result anyref)
+ (loop $loop-in24 (result anyref)
(global.get $global_externref)
)
)
(drop
- (loop $loop-in33 (result anyref)
+ (loop $loop-in25 (result anyref)
(ref.null extern)
)
)
(drop
- (loop $loop-in34 (result anyref)
+ (loop $loop-in26 (result anyref)
(local.get $local_funcref)
)
)
(drop
- (loop $loop-in35 (result anyref)
+ (loop $loop-in27 (result anyref)
(global.get $global_funcref)
)
)
(drop
- (loop $loop-in36 (result anyref)
+ (loop $loop-in28 (result anyref)
(ref.null func)
)
)
(drop
- (loop $loop-in37 (result anyref)
+ (loop $loop-in29 (result anyref)
(ref.func $foo)
)
)
(drop
- (loop $loop-in38 (result anyref)
- (local.get $local_exnref)
- )
- )
- (drop
- (loop $loop-in39 (result anyref)
- (global.get $global_exnref)
- )
- )
- (drop
- (loop $loop-in40 (result anyref)
- (ref.null exn)
- )
- )
- (drop
(if (result externref)
(i32.const 1)
(local.get $local_externref)
@@ -635,13 +479,6 @@
)
)
(drop
- (if (result exnref)
- (i32.const 1)
- (local.get $local_exnref)
- (ref.null exn)
- )
- )
- (drop
(if (result anyref)
(i32.const 1)
(local.get $local_anyref)
@@ -658,20 +495,6 @@
(drop
(if (result anyref)
(i32.const 1)
- (local.get $local_externref)
- (local.get $local_exnref)
- )
- )
- (drop
- (if (result anyref)
- (i32.const 1)
- (local.get $local_funcref)
- (local.get $local_exnref)
- )
- )
- (drop
- (if (result anyref)
- (i32.const 1)
(ref.null extern)
(ref.null func)
)
@@ -679,20 +502,6 @@
(drop
(if (result anyref)
(i32.const 1)
- (ref.null extern)
- (ref.null exn)
- )
- )
- (drop
- (if (result anyref)
- (i32.const 1)
- (ref.null func)
- (ref.null exn)
- )
- )
- (drop
- (if (result anyref)
- (i32.const 1)
(ref.func $foo)
(ref.null extern)
)
@@ -724,19 +533,6 @@
)
)
(drop
- (try (result exnref)
- (do
- (ref.null exn)
- )
- (catch $e-i32
- (drop
- (pop i32)
- )
- (ref.null exn)
- )
- )
- )
- (drop
(try (result anyref)
(do
(local.get $local_externref)
@@ -752,69 +548,17 @@
(drop
(try (result anyref)
(do
- (local.get $local_externref)
- )
- (catch $e-i32
- (drop
- (pop i32)
- )
- (local.get $local_exnref)
- )
- )
- )
- (drop
- (try (result anyref)
- (do
- (ref.func $foo)
- )
- (catch $e-i32
- (drop
- (pop i32)
- )
- (local.get $local_externref)
- )
- )
- )
- (drop
- (try (result anyref)
- (do
(ref.func $foo)
)
(catch $e-i32
(drop
(pop i32)
)
- (local.get $local_exnref)
- )
- )
- )
- (drop
- (try (result anyref)
- (do
- (ref.null exn)
- )
- (catch $e-i32
- (drop
- (pop i32)
- )
(local.get $local_externref)
)
)
)
(drop
- (try (result anyref)
- (do
- (ref.null exn)
- )
- (catch $e-i32
- (drop
- (pop i32)
- )
- (ref.func $foo)
- )
- )
- )
- (drop
(select (result externref)
(local.get $local_externref)
(ref.null extern)
@@ -829,13 +573,6 @@
)
)
(drop
- (select (result exnref)
- (local.get $local_exnref)
- (ref.null exn)
- (i32.const 1)
- )
- )
- (drop
(select
(i32.const 0)
(i32.const 2)
@@ -851,40 +588,12 @@
)
(drop
(select (result anyref)
- (local.get $local_externref)
- (local.get $local_exnref)
- (i32.const 1)
- )
- )
- (drop
- (select (result anyref)
(local.get $local_funcref)
(local.get $local_externref)
(i32.const 1)
)
)
(drop
- (select (result anyref)
- (local.get $local_funcref)
- (local.get $local_exnref)
- (i32.const 1)
- )
- )
- (drop
- (select (result anyref)
- (local.get $local_exnref)
- (local.get $local_externref)
- (i32.const 1)
- )
- )
- (drop
- (select (result anyref)
- (local.get $local_exnref)
- (local.get $local_funcref)
- (i32.const 1)
- )
- )
- (drop
(ref.is_null
(local.get $local_externref)
)
@@ -921,21 +630,6 @@
)
(drop
(ref.is_null
- (local.get $local_exnref)
- )
- )
- (drop
- (ref.is_null
- (global.get $global_exnref)
- )
- )
- (drop
- (ref.is_null
- (ref.null exn)
- )
- )
- (drop
- (ref.is_null
(local.get $local_anyref)
)
)
@@ -973,16 +667,6 @@
(func $return_funcref_func (result funcref)
(ref.func $foo)
)
- (func $return_exnref_local (result exnref)
- (local $local_exnref exnref)
- (local.get $local_exnref)
- )
- (func $return_exnref_global (result exnref)
- (global.get $global_exnref)
- )
- (func $return_exnref_null (result exnref)
- (ref.null exn)
- )
(func $return_anyref_local (result anyref)
(local $local_anyref anyref)
(local.get $local_anyref)
@@ -1016,16 +700,6 @@
(func $return_anyref8 (result anyref)
(ref.func $foo)
)
- (func $return_anyref9 (result anyref)
- (local $local_exnref exnref)
- (local.get $local_exnref)
- )
- (func $return_anyref10 (result anyref)
- (global.get $global_exnref)
- )
- (func $return_anyref11 (result anyref)
- (ref.null exn)
- )
(func $returns_externref (result externref)
(local $local_externref externref)
(return
@@ -1053,18 +727,6 @@
(ref.null func)
)
)
- (func $returns_exnref (result exnref)
- (local $local_exnref exnref)
- (return
- (local.get $local_exnref)
- )
- (return
- (global.get $global_exnref)
- )
- (return
- (ref.null exn)
- )
- )
(func $returns_anyref (result anyref)
(local $local_anyref anyref)
(return
@@ -1080,7 +742,6 @@
(func $returns_anyref2 (result anyref)
(local $local_externref externref)
(local $local_funcref funcref)
- (local $local_exnref exnref)
(return
(local.get $local_externref)
)
@@ -1102,14 +763,5 @@
(return
(ref.null func)
)
- (return
- (local.get $local_exnref)
- )
- (return
- (global.get $global_exnref)
- )
- (return
- (ref.null exn)
- )
)
)
diff --git a/test/reference-types.wast.fromBinary b/test/reference-types.wast.fromBinary
index 50d403caf..ae54cfcd8 100644
--- a/test/reference-types.wast.fromBinary
+++ b/test/reference-types.wast.fromBinary
@@ -4,25 +4,21 @@
(type $funcref_=>_none (func (param funcref)))
(type $none_=>_funcref (func (result funcref)))
(type $externref_=>_none (func (param externref)))
- (type $exnref_=>_none (func (param exnref)))
(type $none_=>_externref (func (result externref)))
- (type $none_=>_exnref (func (result exnref)))
(type $none_=>_none (func))
(type $i32_=>_none (func (param i32)))
(type $externref_=>_funcref (func (param externref) (result funcref)))
(import "env" "import_global" (global $import_global externref))
(import "env" "import_func" (func $import_func (param externref) (result funcref)))
- (table $0 4 4 funcref)
- (elem (i32.const 0) $take_externref $take_funcref $take_exnref $take_anyref)
+ (table $0 3 3 funcref)
+ (elem (i32.const 0) $take_externref $take_funcref $take_anyref)
(global $global_externref (mut externref) (ref.null extern))
(global $global_funcref (mut funcref) (ref.null func))
(global $global_funcref_func (mut funcref) (ref.func $foo))
- (global $global_exnref (mut exnref) (ref.null exn))
(global $global_anyref (mut anyref) (ref.null any))
(global $global_anyref2 (mut anyref) (ref.null extern))
(global $global_anyref3 (mut anyref) (ref.null func))
(global $global_anyref4 (mut anyref) (ref.func $foo))
- (global $global_anyref5 (mut anyref) (ref.null exn))
(event $event$0 (attr 0) (param i32))
(export "export_func" (func $import_func))
(export "export_global" (global $import_global))
@@ -32,9 +28,6 @@
(func $take_funcref (param $0 funcref)
(nop)
)
- (func $take_exnref (param $0 exnref)
- (nop)
- )
(func $take_anyref (param $0 anyref)
(nop)
)
@@ -44,7 +37,6 @@
(func $test
(local $local_externref funcref)
(local $local_funcref externref)
- (local $local_exnref exnref)
(local $local_anyref anyref)
(local.set $local_funcref
(local.get $local_funcref)
@@ -67,15 +59,6 @@
(local.set $local_externref
(ref.func $foo)
)
- (local.set $local_exnref
- (local.get $local_exnref)
- )
- (local.set $local_exnref
- (global.get $global_exnref)
- )
- (local.set $local_exnref
- (ref.null exn)
- )
(local.set $local_anyref
(local.get $local_anyref)
)
@@ -106,15 +89,6 @@
(local.set $local_anyref
(ref.func $foo)
)
- (local.set $local_anyref
- (local.get $local_exnref)
- )
- (local.set $local_anyref
- (global.get $global_exnref)
- )
- (local.set $local_anyref
- (ref.null exn)
- )
(global.set $global_externref
(global.get $global_externref)
)
@@ -136,15 +110,6 @@
(global.set $global_funcref
(ref.func $foo)
)
- (global.set $global_exnref
- (global.get $global_exnref)
- )
- (global.set $global_exnref
- (local.get $local_exnref)
- )
- (global.set $global_exnref
- (ref.null exn)
- )
(global.set $global_anyref
(global.get $global_anyref)
)
@@ -175,15 +140,6 @@
(global.set $global_anyref
(ref.func $foo)
)
- (global.set $global_anyref
- (global.get $global_exnref)
- )
- (global.set $global_anyref
- (local.get $local_exnref)
- )
- (global.set $global_anyref
- (ref.null exn)
- )
(call $take_externref
(local.get $local_funcref)
)
@@ -205,15 +161,6 @@
(call $take_funcref
(ref.func $foo)
)
- (call $take_exnref
- (local.get $local_exnref)
- )
- (call $take_exnref
- (global.get $global_exnref)
- )
- (call $take_exnref
- (ref.null exn)
- )
(call $take_anyref
(local.get $local_anyref)
)
@@ -244,15 +191,6 @@
(call $take_anyref
(ref.func $foo)
)
- (call $take_anyref
- (local.get $local_exnref)
- )
- (call $take_anyref
- (global.get $global_exnref)
- )
- (call $take_anyref
- (ref.null exn)
- )
(call_indirect (type $externref_=>_none)
(local.get $local_funcref)
(i32.const 0)
@@ -281,18 +219,6 @@
(ref.func $foo)
(i32.const 1)
)
- (call_indirect (type $exnref_=>_none)
- (local.get $local_exnref)
- (i32.const 2)
- )
- (call_indirect (type $exnref_=>_none)
- (global.get $global_exnref)
- (i32.const 2)
- )
- (call_indirect (type $exnref_=>_none)
- (ref.null exn)
- (i32.const 2)
- )
(call_indirect (type $anyref_=>_none)
(local.get $local_anyref)
(i32.const 3)
@@ -333,18 +259,6 @@
(ref.func $foo)
(i32.const 3)
)
- (call_indirect (type $anyref_=>_none)
- (local.get $local_exnref)
- (i32.const 3)
- )
- (call_indirect (type $anyref_=>_none)
- (global.get $global_exnref)
- (i32.const 3)
- )
- (call_indirect (type $anyref_=>_none)
- (ref.null exn)
- (i32.const 3)
- )
(drop
(block $label$1 (result externref)
(br_if $label$1
@@ -402,25 +316,25 @@
)
)
(drop
- (block $label$8 (result exnref)
+ (block $label$8 (result anyref)
(br_if $label$8
- (local.get $local_exnref)
+ (local.get $local_anyref)
(i32.const 1)
)
)
)
(drop
- (block $label$9 (result exnref)
+ (block $label$9 (result anyref)
(br_if $label$9
- (global.get $global_exnref)
+ (global.get $global_anyref)
(i32.const 1)
)
)
)
(drop
- (block $label$10 (result exnref)
+ (block $label$10 (result anyref)
(br_if $label$10
- (ref.null exn)
+ (ref.null any)
(i32.const 1)
)
)
@@ -428,7 +342,7 @@
(drop
(block $label$11 (result anyref)
(br_if $label$11
- (local.get $local_anyref)
+ (local.get $local_funcref)
(i32.const 1)
)
)
@@ -436,7 +350,7 @@
(drop
(block $label$12 (result anyref)
(br_if $label$12
- (global.get $global_anyref)
+ (local.get $local_externref)
(i32.const 1)
)
)
@@ -444,7 +358,7 @@
(drop
(block $label$13 (result anyref)
(br_if $label$13
- (ref.null any)
+ (ref.null extern)
(i32.const 1)
)
)
@@ -452,7 +366,7 @@
(drop
(block $label$14 (result anyref)
(br_if $label$14
- (local.get $local_funcref)
+ (ref.null func)
(i32.const 1)
)
)
@@ -460,167 +374,97 @@
(drop
(block $label$15 (result anyref)
(br_if $label$15
- (local.get $local_externref)
- (i32.const 1)
- )
- )
- )
- (drop
- (block $label$16 (result anyref)
- (br_if $label$16
- (local.get $local_exnref)
- (i32.const 1)
- )
- )
- )
- (drop
- (block $label$17 (result anyref)
- (br_if $label$17
- (ref.null extern)
- (i32.const 1)
- )
- )
- )
- (drop
- (block $label$18 (result anyref)
- (br_if $label$18
- (ref.null func)
- (i32.const 1)
- )
- )
- )
- (drop
- (block $label$19 (result anyref)
- (br_if $label$19
(ref.func $foo)
(i32.const 1)
)
)
)
(drop
- (block $label$20 (result anyref)
- (br_if $label$20
- (ref.null exn)
- (i32.const 1)
- )
- )
- )
- (drop
- (loop $label$21 (result externref)
+ (loop $label$16 (result externref)
(local.get $local_funcref)
)
)
(drop
- (loop $label$22 (result externref)
+ (loop $label$17 (result externref)
(global.get $global_externref)
)
)
(drop
- (loop $label$23 (result externref)
+ (loop $label$18 (result externref)
(ref.null extern)
)
)
(drop
- (loop $label$24 (result funcref)
+ (loop $label$19 (result funcref)
(local.get $local_externref)
)
)
(drop
- (loop $label$25 (result funcref)
+ (loop $label$20 (result funcref)
(global.get $global_funcref)
)
)
(drop
- (loop $label$26 (result funcref)
+ (loop $label$21 (result funcref)
(ref.null func)
)
)
(drop
- (loop $label$27 (result funcref)
+ (loop $label$22 (result funcref)
(ref.func $foo)
)
)
(drop
- (loop $label$28 (result exnref)
- (local.get $local_exnref)
- )
- )
- (drop
- (loop $label$29 (result exnref)
- (global.get $global_exnref)
- )
- )
- (drop
- (loop $label$30 (result exnref)
- (ref.null exn)
- )
- )
- (drop
- (loop $label$31 (result anyref)
+ (loop $label$23 (result anyref)
(local.get $local_anyref)
)
)
(drop
- (loop $label$32 (result anyref)
+ (loop $label$24 (result anyref)
(global.get $global_anyref)
)
)
(drop
- (loop $label$33 (result anyref)
+ (loop $label$25 (result anyref)
(ref.null any)
)
)
(drop
- (loop $label$34 (result anyref)
+ (loop $label$26 (result anyref)
(local.get $local_funcref)
)
)
(drop
- (loop $label$35 (result anyref)
+ (loop $label$27 (result anyref)
(global.get $global_externref)
)
)
(drop
- (loop $label$36 (result anyref)
+ (loop $label$28 (result anyref)
(ref.null extern)
)
)
(drop
- (loop $label$37 (result anyref)
+ (loop $label$29 (result anyref)
(local.get $local_externref)
)
)
(drop
- (loop $label$38 (result anyref)
+ (loop $label$30 (result anyref)
(global.get $global_funcref)
)
)
(drop
- (loop $label$39 (result anyref)
+ (loop $label$31 (result anyref)
(ref.null func)
)
)
(drop
- (loop $label$40 (result anyref)
+ (loop $label$32 (result anyref)
(ref.func $foo)
)
)
(drop
- (loop $label$41 (result anyref)
- (local.get $local_exnref)
- )
- )
- (drop
- (loop $label$42 (result anyref)
- (global.get $global_exnref)
- )
- )
- (drop
- (loop $label$43 (result anyref)
- (ref.null exn)
- )
- )
- (drop
(if (result externref)
(i32.const 1)
(local.get $local_funcref)
@@ -635,13 +479,6 @@
)
)
(drop
- (if (result exnref)
- (i32.const 1)
- (local.get $local_exnref)
- (ref.null exn)
- )
- )
- (drop
(if (result anyref)
(i32.const 1)
(local.get $local_anyref)
@@ -658,20 +495,6 @@
(drop
(if (result anyref)
(i32.const 1)
- (local.get $local_funcref)
- (local.get $local_exnref)
- )
- )
- (drop
- (if (result anyref)
- (i32.const 1)
- (local.get $local_externref)
- (local.get $local_exnref)
- )
- )
- (drop
- (if (result anyref)
- (i32.const 1)
(ref.null extern)
(ref.null func)
)
@@ -679,20 +502,6 @@
(drop
(if (result anyref)
(i32.const 1)
- (ref.null extern)
- (ref.null exn)
- )
- )
- (drop
- (if (result anyref)
- (i32.const 1)
- (ref.null func)
- (ref.null exn)
- )
- )
- (drop
- (if (result anyref)
- (i32.const 1)
(ref.func $foo)
(ref.null extern)
)
@@ -724,19 +533,6 @@
)
)
(drop
- (try (result exnref)
- (do
- (ref.null exn)
- )
- (catch $event$0
- (drop
- (pop i32)
- )
- (ref.null exn)
- )
- )
- )
- (drop
(try (result anyref)
(do
(local.get $local_funcref)
@@ -752,19 +548,6 @@
(drop
(try (result anyref)
(do
- (local.get $local_funcref)
- )
- (catch $event$0
- (drop
- (pop i32)
- )
- (local.get $local_exnref)
- )
- )
- )
- (drop
- (try (result anyref)
- (do
(ref.func $foo)
)
(catch $event$0
@@ -776,45 +559,6 @@
)
)
(drop
- (try (result anyref)
- (do
- (ref.func $foo)
- )
- (catch $event$0
- (drop
- (pop i32)
- )
- (local.get $local_exnref)
- )
- )
- )
- (drop
- (try (result anyref)
- (do
- (ref.null exn)
- )
- (catch $event$0
- (drop
- (pop i32)
- )
- (local.get $local_funcref)
- )
- )
- )
- (drop
- (try (result anyref)
- (do
- (ref.null exn)
- )
- (catch $event$0
- (drop
- (pop i32)
- )
- (ref.func $foo)
- )
- )
- )
- (drop
(select (result externref)
(local.get $local_funcref)
(ref.null extern)
@@ -829,13 +573,6 @@
)
)
(drop
- (select (result exnref)
- (local.get $local_exnref)
- (ref.null exn)
- (i32.const 1)
- )
- )
- (drop
(select
(i32.const 0)
(i32.const 2)
@@ -851,40 +588,12 @@
)
(drop
(select (result anyref)
- (local.get $local_funcref)
- (local.get $local_exnref)
- (i32.const 1)
- )
- )
- (drop
- (select (result anyref)
(local.get $local_externref)
(local.get $local_funcref)
(i32.const 1)
)
)
(drop
- (select (result anyref)
- (local.get $local_externref)
- (local.get $local_exnref)
- (i32.const 1)
- )
- )
- (drop
- (select (result anyref)
- (local.get $local_exnref)
- (local.get $local_funcref)
- (i32.const 1)
- )
- )
- (drop
- (select (result anyref)
- (local.get $local_exnref)
- (local.get $local_externref)
- (i32.const 1)
- )
- )
- (drop
(ref.is_null
(local.get $local_funcref)
)
@@ -921,21 +630,6 @@
)
(drop
(ref.is_null
- (local.get $local_exnref)
- )
- )
- (drop
- (ref.is_null
- (global.get $global_exnref)
- )
- )
- (drop
- (ref.is_null
- (ref.null exn)
- )
- )
- (drop
- (ref.is_null
(local.get $local_anyref)
)
)
@@ -973,16 +667,6 @@
(func $return_funcref_func (result funcref)
(ref.func $foo)
)
- (func $return_exnref_local (result exnref)
- (local $local_exnref exnref)
- (local.get $local_exnref)
- )
- (func $return_exnref_global (result exnref)
- (global.get $global_exnref)
- )
- (func $return_exnref_null (result exnref)
- (ref.null exn)
- )
(func $return_anyref_local (result anyref)
(local $local_anyref anyref)
(local.get $local_anyref)
@@ -1016,16 +700,6 @@
(func $return_anyref8 (result anyref)
(ref.func $foo)
)
- (func $return_anyref9 (result anyref)
- (local $local_exnref exnref)
- (local.get $local_exnref)
- )
- (func $return_anyref10 (result anyref)
- (global.get $global_exnref)
- )
- (func $return_anyref11 (result anyref)
- (ref.null exn)
- )
(func $returns_externref (result externref)
(local $local_externref externref)
(return
@@ -1038,12 +712,6 @@
(local.get $local_funcref)
)
)
- (func $returns_exnref (result exnref)
- (local $local_exnref exnref)
- (return
- (local.get $local_exnref)
- )
- )
(func $returns_anyref (result anyref)
(local $local_anyref anyref)
(return
@@ -1053,7 +721,6 @@
(func $returns_anyref2 (result anyref)
(local $local_externref funcref)
(local $local_funcref externref)
- (local $local_exnref exnref)
(return
(local.get $local_funcref)
)
diff --git a/test/reference-types.wast.fromBinary.noDebugInfo b/test/reference-types.wast.fromBinary.noDebugInfo
index d60129e01..08186f32b 100644
--- a/test/reference-types.wast.fromBinary.noDebugInfo
+++ b/test/reference-types.wast.fromBinary.noDebugInfo
@@ -4,25 +4,21 @@
(type $funcref_=>_none (func (param funcref)))
(type $none_=>_funcref (func (result funcref)))
(type $externref_=>_none (func (param externref)))
- (type $exnref_=>_none (func (param exnref)))
(type $none_=>_externref (func (result externref)))
- (type $none_=>_exnref (func (result exnref)))
(type $none_=>_none (func))
(type $i32_=>_none (func (param i32)))
(type $externref_=>_funcref (func (param externref) (result funcref)))
(import "env" "import_global" (global $gimport$0 externref))
(import "env" "import_func" (func $fimport$0 (param externref) (result funcref)))
- (table $0 4 4 funcref)
- (elem (i32.const 0) $0 $1 $2 $3)
+ (table $0 3 3 funcref)
+ (elem (i32.const 0) $0 $1 $2)
(global $global$0 (mut externref) (ref.null extern))
(global $global$1 (mut funcref) (ref.null func))
- (global $global$2 (mut funcref) (ref.func $4))
- (global $global$3 (mut exnref) (ref.null exn))
- (global $global$4 (mut anyref) (ref.null any))
- (global $global$5 (mut anyref) (ref.null extern))
- (global $global$6 (mut anyref) (ref.null func))
- (global $global$7 (mut anyref) (ref.func $4))
- (global $global$8 (mut anyref) (ref.null exn))
+ (global $global$2 (mut funcref) (ref.func $3))
+ (global $global$3 (mut anyref) (ref.null any))
+ (global $global$4 (mut anyref) (ref.null extern))
+ (global $global$5 (mut anyref) (ref.null func))
+ (global $global$6 (mut anyref) (ref.func $3))
(event $event$0 (attr 0) (param i32))
(export "export_func" (func $fimport$0))
(export "export_global" (global $gimport$0))
@@ -32,20 +28,16 @@
(func $1 (param $0 funcref)
(nop)
)
- (func $2 (param $0 exnref)
+ (func $2 (param $0 anyref)
(nop)
)
- (func $3 (param $0 anyref)
+ (func $3
(nop)
)
(func $4
- (nop)
- )
- (func $5
(local $0 funcref)
(local $1 externref)
- (local $2 exnref)
- (local $3 anyref)
+ (local $2 anyref)
(local.set $1
(local.get $1)
)
@@ -65,7 +57,7 @@
(ref.null func)
)
(local.set $0
- (ref.func $4)
+ (ref.func $3)
)
(local.set $2
(local.get $2)
@@ -74,46 +66,28 @@
(global.get $global$3)
)
(local.set $2
- (ref.null exn)
- )
- (local.set $3
- (local.get $3)
- )
- (local.set $3
- (global.get $global$4)
- )
- (local.set $3
(ref.null any)
)
- (local.set $3
+ (local.set $2
(local.get $1)
)
- (local.set $3
+ (local.set $2
(global.get $global$0)
)
- (local.set $3
+ (local.set $2
(ref.null extern)
)
- (local.set $3
+ (local.set $2
(local.get $0)
)
- (local.set $3
+ (local.set $2
(global.get $global$1)
)
- (local.set $3
+ (local.set $2
(ref.null func)
)
- (local.set $3
- (ref.func $4)
- )
- (local.set $3
- (local.get $2)
- )
- (local.set $3
- (global.get $global$3)
- )
- (local.set $3
- (ref.null exn)
+ (local.set $2
+ (ref.func $3)
)
(global.set $global$0
(global.get $global$0)
@@ -134,7 +108,7 @@
(ref.null func)
)
(global.set $global$1
- (ref.func $4)
+ (ref.func $3)
)
(global.set $global$3
(global.get $global$3)
@@ -143,46 +117,28 @@
(local.get $2)
)
(global.set $global$3
- (ref.null exn)
- )
- (global.set $global$4
- (global.get $global$4)
- )
- (global.set $global$4
- (local.get $3)
- )
- (global.set $global$4
(ref.null any)
)
- (global.set $global$4
+ (global.set $global$3
(global.get $global$0)
)
- (global.set $global$4
+ (global.set $global$3
(local.get $1)
)
- (global.set $global$4
+ (global.set $global$3
(ref.null extern)
)
- (global.set $global$4
+ (global.set $global$3
(global.get $global$1)
)
- (global.set $global$4
+ (global.set $global$3
(local.get $0)
)
- (global.set $global$4
+ (global.set $global$3
(ref.null func)
)
- (global.set $global$4
- (ref.func $4)
- )
- (global.set $global$4
- (global.get $global$3)
- )
- (global.set $global$4
- (local.get $2)
- )
- (global.set $global$4
- (ref.null exn)
+ (global.set $global$3
+ (ref.func $3)
)
(call $0
(local.get $1)
@@ -203,7 +159,7 @@
(ref.null func)
)
(call $1
- (ref.func $4)
+ (ref.func $3)
)
(call $2
(local.get $2)
@@ -212,46 +168,28 @@
(global.get $global$3)
)
(call $2
- (ref.null exn)
- )
- (call $3
- (local.get $3)
- )
- (call $3
- (global.get $global$4)
- )
- (call $3
(ref.null any)
)
- (call $3
+ (call $2
(local.get $1)
)
- (call $3
+ (call $2
(global.get $global$0)
)
- (call $3
+ (call $2
(ref.null extern)
)
- (call $3
+ (call $2
(local.get $0)
)
- (call $3
+ (call $2
(global.get $global$1)
)
- (call $3
+ (call $2
(ref.null func)
)
- (call $3
- (ref.func $4)
- )
- (call $3
- (local.get $2)
- )
- (call $3
- (global.get $global$3)
- )
- (call $3
- (ref.null exn)
+ (call $2
+ (ref.func $3)
)
(call_indirect (type $externref_=>_none)
(local.get $1)
@@ -278,27 +216,15 @@
(i32.const 1)
)
(call_indirect (type $funcref_=>_none)
- (ref.func $4)
+ (ref.func $3)
(i32.const 1)
)
- (call_indirect (type $exnref_=>_none)
- (local.get $2)
- (i32.const 2)
- )
- (call_indirect (type $exnref_=>_none)
- (global.get $global$3)
- (i32.const 2)
- )
- (call_indirect (type $exnref_=>_none)
- (ref.null exn)
- (i32.const 2)
- )
(call_indirect (type $anyref_=>_none)
- (local.get $3)
+ (local.get $2)
(i32.const 3)
)
(call_indirect (type $anyref_=>_none)
- (global.get $global$4)
+ (global.get $global$3)
(i32.const 3)
)
(call_indirect (type $anyref_=>_none)
@@ -330,19 +256,7 @@
(i32.const 3)
)
(call_indirect (type $anyref_=>_none)
- (ref.func $4)
- (i32.const 3)
- )
- (call_indirect (type $anyref_=>_none)
- (local.get $2)
- (i32.const 3)
- )
- (call_indirect (type $anyref_=>_none)
- (global.get $global$3)
- (i32.const 3)
- )
- (call_indirect (type $anyref_=>_none)
- (ref.null exn)
+ (ref.func $3)
(i32.const 3)
)
(drop
@@ -396,13 +310,13 @@
(drop
(block $label$7 (result funcref)
(br_if $label$7
- (ref.func $4)
+ (ref.func $3)
(i32.const 1)
)
)
)
(drop
- (block $label$8 (result exnref)
+ (block $label$8 (result anyref)
(br_if $label$8
(local.get $2)
(i32.const 1)
@@ -410,7 +324,7 @@
)
)
(drop
- (block $label$9 (result exnref)
+ (block $label$9 (result anyref)
(br_if $label$9
(global.get $global$3)
(i32.const 1)
@@ -418,9 +332,9 @@
)
)
(drop
- (block $label$10 (result exnref)
+ (block $label$10 (result anyref)
(br_if $label$10
- (ref.null exn)
+ (ref.null any)
(i32.const 1)
)
)
@@ -428,7 +342,7 @@
(drop
(block $label$11 (result anyref)
(br_if $label$11
- (local.get $3)
+ (local.get $1)
(i32.const 1)
)
)
@@ -436,7 +350,7 @@
(drop
(block $label$12 (result anyref)
(br_if $label$12
- (global.get $global$4)
+ (local.get $0)
(i32.const 1)
)
)
@@ -444,7 +358,7 @@
(drop
(block $label$13 (result anyref)
(br_if $label$13
- (ref.null any)
+ (ref.null extern)
(i32.const 1)
)
)
@@ -452,7 +366,7 @@
(drop
(block $label$14 (result anyref)
(br_if $label$14
- (local.get $1)
+ (ref.null func)
(i32.const 1)
)
)
@@ -460,164 +374,94 @@
(drop
(block $label$15 (result anyref)
(br_if $label$15
- (local.get $0)
+ (ref.func $3)
(i32.const 1)
)
)
)
(drop
- (block $label$16 (result anyref)
- (br_if $label$16
- (local.get $2)
- (i32.const 1)
- )
- )
- )
- (drop
- (block $label$17 (result anyref)
- (br_if $label$17
- (ref.null extern)
- (i32.const 1)
- )
- )
- )
- (drop
- (block $label$18 (result anyref)
- (br_if $label$18
- (ref.null func)
- (i32.const 1)
- )
- )
- )
- (drop
- (block $label$19 (result anyref)
- (br_if $label$19
- (ref.func $4)
- (i32.const 1)
- )
- )
- )
- (drop
- (block $label$20 (result anyref)
- (br_if $label$20
- (ref.null exn)
- (i32.const 1)
- )
- )
- )
- (drop
- (loop $label$21 (result externref)
+ (loop $label$16 (result externref)
(local.get $1)
)
)
(drop
- (loop $label$22 (result externref)
+ (loop $label$17 (result externref)
(global.get $global$0)
)
)
(drop
- (loop $label$23 (result externref)
+ (loop $label$18 (result externref)
(ref.null extern)
)
)
(drop
- (loop $label$24 (result funcref)
+ (loop $label$19 (result funcref)
(local.get $0)
)
)
(drop
- (loop $label$25 (result funcref)
+ (loop $label$20 (result funcref)
(global.get $global$1)
)
)
(drop
- (loop $label$26 (result funcref)
+ (loop $label$21 (result funcref)
(ref.null func)
)
)
(drop
- (loop $label$27 (result funcref)
- (ref.func $4)
+ (loop $label$22 (result funcref)
+ (ref.func $3)
)
)
(drop
- (loop $label$28 (result exnref)
+ (loop $label$23 (result anyref)
(local.get $2)
)
)
(drop
- (loop $label$29 (result exnref)
+ (loop $label$24 (result anyref)
(global.get $global$3)
)
)
(drop
- (loop $label$30 (result exnref)
- (ref.null exn)
- )
- )
- (drop
- (loop $label$31 (result anyref)
- (local.get $3)
- )
- )
- (drop
- (loop $label$32 (result anyref)
- (global.get $global$4)
- )
- )
- (drop
- (loop $label$33 (result anyref)
+ (loop $label$25 (result anyref)
(ref.null any)
)
)
(drop
- (loop $label$34 (result anyref)
+ (loop $label$26 (result anyref)
(local.get $1)
)
)
(drop
- (loop $label$35 (result anyref)
+ (loop $label$27 (result anyref)
(global.get $global$0)
)
)
(drop
- (loop $label$36 (result anyref)
+ (loop $label$28 (result anyref)
(ref.null extern)
)
)
(drop
- (loop $label$37 (result anyref)
+ (loop $label$29 (result anyref)
(local.get $0)
)
)
(drop
- (loop $label$38 (result anyref)
+ (loop $label$30 (result anyref)
(global.get $global$1)
)
)
(drop
- (loop $label$39 (result anyref)
+ (loop $label$31 (result anyref)
(ref.null func)
)
)
(drop
- (loop $label$40 (result anyref)
- (ref.func $4)
- )
- )
- (drop
- (loop $label$41 (result anyref)
- (local.get $2)
- )
- )
- (drop
- (loop $label$42 (result anyref)
- (global.get $global$3)
- )
- )
- (drop
- (loop $label$43 (result anyref)
- (ref.null exn)
+ (loop $label$32 (result anyref)
+ (ref.func $3)
)
)
(drop
@@ -635,16 +479,9 @@
)
)
(drop
- (if (result exnref)
- (i32.const 1)
- (local.get $2)
- (ref.null exn)
- )
- )
- (drop
(if (result anyref)
(i32.const 1)
- (local.get $3)
+ (local.get $2)
(ref.null any)
)
)
@@ -658,20 +495,6 @@
(drop
(if (result anyref)
(i32.const 1)
- (local.get $1)
- (local.get $2)
- )
- )
- (drop
- (if (result anyref)
- (i32.const 1)
- (local.get $0)
- (local.get $2)
- )
- )
- (drop
- (if (result anyref)
- (i32.const 1)
(ref.null extern)
(ref.null func)
)
@@ -679,21 +502,7 @@
(drop
(if (result anyref)
(i32.const 1)
- (ref.null extern)
- (ref.null exn)
- )
- )
- (drop
- (if (result anyref)
- (i32.const 1)
- (ref.null func)
- (ref.null exn)
- )
- )
- (drop
- (if (result anyref)
- (i32.const 1)
- (ref.func $4)
+ (ref.func $3)
(ref.null extern)
)
)
@@ -713,7 +522,7 @@
(drop
(try (result funcref)
(do
- (ref.func $4)
+ (ref.func $3)
)
(catch $event$0
(drop
@@ -724,32 +533,6 @@
)
)
(drop
- (try (result exnref)
- (do
- (ref.null exn)
- )
- (catch $event$0
- (drop
- (pop i32)
- )
- (ref.null exn)
- )
- )
- )
- (drop
- (try (result anyref)
- (do
- (local.get $1)
- )
- (catch $event$0
- (drop
- (pop i32)
- )
- (ref.func $4)
- )
- )
- )
- (drop
(try (result anyref)
(do
(local.get $1)
@@ -758,14 +541,14 @@
(drop
(pop i32)
)
- (local.get $2)
+ (ref.func $3)
)
)
)
(drop
(try (result anyref)
(do
- (ref.func $4)
+ (ref.func $3)
)
(catch $event$0
(drop
@@ -776,45 +559,6 @@
)
)
(drop
- (try (result anyref)
- (do
- (ref.func $4)
- )
- (catch $event$0
- (drop
- (pop i32)
- )
- (local.get $2)
- )
- )
- )
- (drop
- (try (result anyref)
- (do
- (ref.null exn)
- )
- (catch $event$0
- (drop
- (pop i32)
- )
- (local.get $1)
- )
- )
- )
- (drop
- (try (result anyref)
- (do
- (ref.null exn)
- )
- (catch $event$0
- (drop
- (pop i32)
- )
- (ref.func $4)
- )
- )
- )
- (drop
(select (result externref)
(local.get $1)
(ref.null extern)
@@ -829,13 +573,6 @@
)
)
(drop
- (select (result exnref)
- (local.get $2)
- (ref.null exn)
- (i32.const 1)
- )
- )
- (drop
(select
(i32.const 0)
(i32.const 2)
@@ -851,40 +588,12 @@
)
(drop
(select (result anyref)
- (local.get $1)
- (local.get $2)
- (i32.const 1)
- )
- )
- (drop
- (select (result anyref)
- (local.get $0)
- (local.get $1)
- (i32.const 1)
- )
- )
- (drop
- (select (result anyref)
(local.get $0)
- (local.get $2)
- (i32.const 1)
- )
- )
- (drop
- (select (result anyref)
- (local.get $2)
(local.get $1)
(i32.const 1)
)
)
(drop
- (select (result anyref)
- (local.get $2)
- (local.get $0)
- (i32.const 1)
- )
- )
- (drop
(ref.is_null
(local.get $1)
)
@@ -916,7 +625,7 @@
)
(drop
(ref.is_null
- (ref.func $4)
+ (ref.func $3)
)
)
(drop
@@ -931,129 +640,87 @@
)
(drop
(ref.is_null
- (ref.null exn)
- )
- )
- (drop
- (ref.is_null
- (local.get $3)
- )
- )
- (drop
- (ref.is_null
- (global.get $global$4)
- )
- )
- (drop
- (ref.is_null
(ref.null any)
)
)
)
- (func $6 (result externref)
+ (func $5 (result externref)
(local $0 externref)
(local.get $0)
)
- (func $7 (result externref)
+ (func $6 (result externref)
(global.get $global$0)
)
- (func $8 (result externref)
+ (func $7 (result externref)
(ref.null extern)
)
- (func $9 (result funcref)
+ (func $8 (result funcref)
(local $0 funcref)
(local.get $0)
)
- (func $10 (result funcref)
+ (func $9 (result funcref)
(global.get $global$1)
)
- (func $11 (result funcref)
+ (func $10 (result funcref)
(ref.null func)
)
- (func $12 (result funcref)
- (ref.func $4)
- )
- (func $13 (result exnref)
- (local $0 exnref)
- (local.get $0)
- )
- (func $14 (result exnref)
- (global.get $global$3)
- )
- (func $15 (result exnref)
- (ref.null exn)
+ (func $11 (result funcref)
+ (ref.func $3)
)
- (func $16 (result anyref)
+ (func $12 (result anyref)
(local $0 anyref)
(local.get $0)
)
- (func $17 (result anyref)
- (global.get $global$4)
+ (func $13 (result anyref)
+ (global.get $global$3)
)
- (func $18 (result anyref)
+ (func $14 (result anyref)
(ref.null any)
)
- (func $19 (result anyref)
+ (func $15 (result anyref)
(local $0 externref)
(local.get $0)
)
- (func $20 (result anyref)
+ (func $16 (result anyref)
(global.get $global$0)
)
- (func $21 (result anyref)
+ (func $17 (result anyref)
(ref.null extern)
)
- (func $22 (result anyref)
+ (func $18 (result anyref)
(local $0 funcref)
(local.get $0)
)
- (func $23 (result anyref)
+ (func $19 (result anyref)
(global.get $global$1)
)
- (func $24 (result anyref)
+ (func $20 (result anyref)
(ref.null func)
)
- (func $25 (result anyref)
- (ref.func $4)
- )
- (func $26 (result anyref)
- (local $0 exnref)
- (local.get $0)
- )
- (func $27 (result anyref)
- (global.get $global$3)
- )
- (func $28 (result anyref)
- (ref.null exn)
+ (func $21 (result anyref)
+ (ref.func $3)
)
- (func $29 (result externref)
+ (func $22 (result externref)
(local $0 externref)
(return
(local.get $0)
)
)
- (func $30 (result funcref)
+ (func $23 (result funcref)
(local $0 funcref)
(return
(local.get $0)
)
)
- (func $31 (result exnref)
- (local $0 exnref)
- (return
- (local.get $0)
- )
- )
- (func $32 (result anyref)
+ (func $24 (result anyref)
(local $0 anyref)
(return
(local.get $0)
)
)
- (func $33 (result anyref)
+ (func $25 (result anyref)
(local $0 funcref)
(local $1 externref)
- (local $2 exnref)
(return
(local.get $1)
)
diff --git a/test/spec/call_indirect_sig_mismatch.wast b/test/spec/call_indirect_sig_mismatch.wast
index 69cca17ba..ca6c000fd 100644
--- a/test/spec/call_indirect_sig_mismatch.wast
+++ b/test/spec/call_indirect_sig_mismatch.wast
@@ -2,7 +2,7 @@
(type $funcref_=>_none (func (param funcref)))
(table funcref (elem $callee))
(export "sig_mismatch" (func $sig_mismatch))
- (func $callee (param $0 exnref))
+ (func $callee (param $0 externref))
(func $sig_mismatch
(call_indirect (type $funcref_=>_none)
(ref.null func)
diff --git a/test/spec/exception-handling.wast b/test/spec/exception-handling.wast
index d951441e0..ebca3a009 100644
--- a/test/spec/exception-handling.wast
+++ b/test/spec/exception-handling.wast
@@ -263,47 +263,3 @@
)
"event's param numbers must match"
)
-
-(assert_invalid
- (module
- (event $e-i32 (attr 0) (param i32))
- (func $f0 (result i32)
- (block $l0 (result i32)
- (drop
- (br_on_exn $l0 $e-i32 (i32.const 0))
- )
- (i32.const 0)
- )
- )
- )
- "br_on_exn's argument must be unreachable or exnref type"
-)
-
-(assert_invalid
- (module
- (event $e-i32 (attr 0) (param i32))
- (func $f0 (result i32) (local $0 exnref)
- (block $l0 (result i32)
- (i32.eqz
- (br_on_exn $l0 $e-i32 (local.get $0))
- )
- )
- )
- )
- "i32.eqz input must be i32"
-)
-
-(assert_invalid
- (module
- (event $e-i32 (attr 0) (param i32))
- (func $f0 (result f32) (local $0 exnref)
- (block $l0 (result f32)
- (drop
- (br_on_exn $l0 $e-i32 (local.get $0))
- )
- (f32.const 0)
- )
- )
- )
- "block+breaks must have right type if breaks return a value"
-)
diff --git a/test/unit/test_features.py b/test/unit/test_features.py
index 01ea4c754..7eb814e39 100644
--- a/test/unit/test_features.py
+++ b/test/unit/test_features.py
@@ -187,16 +187,6 @@ class FeatureValidationTest(utils.BinaryenTestCase):
'''
self.check_reference_types(module, 'all used types should be allowed')
- def test_exnref_local(self):
- module = '''
- (module
- (func $foo
- (local exnref)
- )
- )
- '''
- self.check_exception_handling(module, 'all used types should be allowed')
-
def test_event(self):
module = '''
(module