summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2022-08-17 22:51:27 -0700
committerGitHub <noreply@github.com>2022-08-17 22:51:27 -0700
commit2d86d1f8fb217456d8bcc4b401ce7d143aa36ee9 (patch)
treeec852da20ed85c7e5f9be7a5e3fb0632d7caf949 /test
parent3aff4c6e85623c970280219c6699a66bc9de5f9b (diff)
downloadbinaryen-2d86d1f8fb217456d8bcc4b401ce7d143aa36ee9.tar.gz
binaryen-2d86d1f8fb217456d8bcc4b401ce7d143aa36ee9.tar.bz2
binaryen-2d86d1f8fb217456d8bcc4b401ce7d143aa36ee9.zip
Restore the `extern` heap type (#4898)
The GC proposal has split `any` and `extern` back into two separate types, so reintroduce `HeapType::ext` to represent `extern`. Before it was originally removed in #4633, externref was a subtype of anyref, but now it is not. Now that we have separate heaptype type hierarchies, make `HeapType::getLeastUpperBound` fallible as well.
Diffstat (limited to 'test')
-rw-r--r--test/binaryen.js/kitchen-sink.js.txt8
-rw-r--r--test/ctor-eval/bad-indirect-call3.wast.out4
-rw-r--r--test/example/c-api-kitchen-sink.c1
-rw-r--r--test/example/c-api-kitchen-sink.txt25
-rw-r--r--test/lit/passes/flatten_all-features.wast46
-rw-r--r--test/lit/passes/gufa-refs.wast4
-rw-r--r--test/lit/passes/instrument-locals_all-features_disable-typed-function-references.wast20
-rw-r--r--test/lit/passes/optimize-instructions-gc.wast14
-rw-r--r--test/multi-table.wast.from-wast2
-rw-r--r--test/multi-table.wast.fromBinary2
-rw-r--r--test/multi-table.wast.fromBinary.noDebugInfo2
-rw-r--r--test/multivalue.wast.from-wast10
-rw-r--r--test/multivalue.wast.fromBinary12
-rw-r--r--test/multivalue.wast.fromBinary.noDebugInfo12
-rw-r--r--test/passes/precompute_all-features.txt12
-rw-r--r--test/passes/simplify-globals_all-features.txt8
-rw-r--r--test/passes/simplify-locals_all-features.txt2
-rw-r--r--test/passes/simplify-locals_all-features.wast2
-rw-r--r--test/passes/strip-target-features_roundtrip_print-features_all-features.txt8
-rw-r--r--test/passes/translate-to-fuzz_all-features_metrics_noprint.txt59
-rw-r--r--test/reference-types.wast186
-rw-r--r--test/reference-types.wast.from-wast202
-rw-r--r--test/reference-types.wast.fromBinary196
-rw-r--r--test/reference-types.wast.fromBinary.noDebugInfo180
-rw-r--r--test/unit/test_features.py2
25 files changed, 511 insertions, 508 deletions
diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt
index 1be13aefe..3e5f9afb0 100644
--- a/test/binaryen.js/kitchen-sink.js.txt
+++ b/test/binaryen.js/kitchen-sink.js.txt
@@ -2057,7 +2057,7 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
)
(drop
(ref.is_null
- (ref.null any)
+ (ref.null extern)
)
)
(drop
@@ -2152,7 +2152,7 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
(pop funcref)
)
(drop
- (pop anyref)
+ (pop externref)
)
(drop
(pop anyref)
@@ -4161,7 +4161,7 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
)
(drop
(ref.is_null
- (ref.null any)
+ (ref.null extern)
)
)
(drop
@@ -4256,7 +4256,7 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
(pop funcref)
)
(drop
- (pop anyref)
+ (pop externref)
)
(drop
(pop anyref)
diff --git a/test/ctor-eval/bad-indirect-call3.wast.out b/test/ctor-eval/bad-indirect-call3.wast.out
index 257bf3168..4b470e10a 100644
--- a/test/ctor-eval/bad-indirect-call3.wast.out
+++ b/test/ctor-eval/bad-indirect-call3.wast.out
@@ -1,5 +1,5 @@
(module
- (type $anyref_=>_none (func (param anyref)))
+ (type $externref_=>_none (func (param externref)))
(type $none_=>_none (func))
(type $funcref_=>_none (func (param funcref)))
(memory $0 256 256)
@@ -7,7 +7,7 @@
(table $0 1 1 funcref)
(elem (i32.const 0) $callee)
(export "sig_mismatch" (func $sig_mismatch))
- (func $callee (param $0 anyref)
+ (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 cb8349f89..f6cee93fa 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -318,6 +318,7 @@ void test_types() {
BinaryenPackedType i16 = BinaryenPackedTypeInt16();
printf("BinaryenPackedTypeInt16: %d\n", i16);
+ printf("BinaryenHeapTypeExt: %zd\n", BinaryenHeapTypeExt());
printf("BinaryenHeapTypeFunc: %zd\n", BinaryenHeapTypeFunc());
printf("BinaryenHeapTypeAny: %zd\n", BinaryenHeapTypeAny());
printf("BinaryenHeapTypeEq: %zd\n", BinaryenHeapTypeEq());
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index ff71e08e5..31a6875bb 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -19,15 +19,16 @@ BinaryenTypeAuto: -1
BinaryenPackedTypeNotPacked: 0
BinaryenPackedTypeInt8: 1
BinaryenPackedTypeInt16: 2
-BinaryenHeapTypeFunc: 0
-BinaryenHeapTypeAny: 1
-BinaryenHeapTypeEq: 2
-BinaryenHeapTypeI31: 3
-BinaryenHeapTypeData: 4
-BinaryenHeapTypeString: 5
-BinaryenHeapTypeStringviewWTF8: 6
-BinaryenHeapTypeStringviewWTF16: 7
-BinaryenHeapTypeStringviewIter: 8
+BinaryenHeapTypeExt: 0
+BinaryenHeapTypeFunc: 1
+BinaryenHeapTypeAny: 2
+BinaryenHeapTypeEq: 3
+BinaryenHeapTypeI31: 4
+BinaryenHeapTypeData: 5
+BinaryenHeapTypeString: 6
+BinaryenHeapTypeStringviewWTF8: 7
+BinaryenHeapTypeStringviewWTF16: 8
+BinaryenHeapTypeStringviewIter: 9
BinaryenFeatureMVP: 0
BinaryenFeatureAtomics: 1
BinaryenFeatureBulkMemory: 16
@@ -81,7 +82,7 @@ BinaryenFeatureAll: 122879
(start $starter)
(func "$kitchen()sinker" (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32)
(local $4 i32)
- (local $5 anyref)
+ (local $5 externref)
(block $the-body (result i32)
(block $the-nothing
(drop
@@ -1962,7 +1963,7 @@ BinaryenFeatureAll: 122879
)
(drop
(ref.is_null
- (ref.null any)
+ (ref.null extern)
)
)
(drop
@@ -2102,7 +2103,7 @@ BinaryenFeatureAll: 122879
(pop funcref)
)
(drop
- (pop anyref)
+ (pop externref)
)
(drop
(pop i32 i64 f32 f64)
diff --git a/test/lit/passes/flatten_all-features.wast b/test/lit/passes/flatten_all-features.wast
index b563159c6..6a9ffc16a 100644
--- a/test/lit/passes/flatten_all-features.wast
+++ b/test/lit/passes/flatten_all-features.wast
@@ -3416,55 +3416,59 @@
;; value type, we need the value to be set into two locals: one with the outer
;; block's type, and one with its value type.
;; CHECK: (func $subtype (result anyref)
- ;; CHECK-NEXT: (local $0 anyref)
+ ;; CHECK-NEXT: (local $0 eqref)
;; CHECK-NEXT: (local $1 anyref)
- ;; CHECK-NEXT: (local $2 anyref)
- ;; CHECK-NEXT: (local $3 anyref)
- ;; CHECK-NEXT: (local $4 anyref)
- ;; CHECK-NEXT: (local $5 anyref)
- ;; CHECK-NEXT: (local $6 anyref)
+ ;; CHECK-NEXT: (local $2 eqref)
+ ;; CHECK-NEXT: (local $3 eqref)
+ ;; CHECK-NEXT: (local $4 eqref)
+ ;; CHECK-NEXT: (local $5 eqref)
+ ;; CHECK-NEXT: (local $6 eqref)
+ ;; CHECK-NEXT: (local $7 anyref)
;; CHECK-NEXT: (block $label0
;; CHECK-NEXT: (block $block
;; CHECK-NEXT: (local.set $1
- ;; CHECK-NEXT: (ref.null any)
+ ;; CHECK-NEXT: (ref.null eq)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $2
+ ;; CHECK-NEXT: (ref.null eq)
;; CHECK-NEXT: )
;; CHECK-NEXT: (br_if $label0
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.set $2
- ;; CHECK-NEXT: (local.get $1)
+ ;; CHECK-NEXT: (local.set $3
+ ;; CHECK-NEXT: (local.get $2)
;; CHECK-NEXT: )
;; CHECK-NEXT: (local.set $0
- ;; CHECK-NEXT: (local.get $2)
+ ;; CHECK-NEXT: (local.get $3)
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.set $3
+ ;; CHECK-NEXT: (local.set $4
;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.set $4
- ;; CHECK-NEXT: (local.get $3)
+ ;; CHECK-NEXT: (local.set $5
+ ;; CHECK-NEXT: (local.get $4)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.set $5
- ;; CHECK-NEXT: (local.get $4)
+ ;; CHECK-NEXT: (local.set $6
+ ;; CHECK-NEXT: (local.get $5)
;; CHECK-NEXT: )
;; CHECK-NEXT: (local.set $1
- ;; CHECK-NEXT: (local.get $5)
+ ;; CHECK-NEXT: (local.get $6)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.set $6
+ ;; CHECK-NEXT: (local.set $7
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (return
- ;; CHECK-NEXT: (local.get $6)
+ ;; CHECK-NEXT: (local.get $7)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $subtype (result anyref)
- (local $0 externref)
+ (local $0 eqref)
(block $label0 (result anyref)
- (block (result externref)
+ (block (result eqref)
(local.tee $0
(br_if $label0
- (ref.null extern)
+ (ref.null eq)
(i32.const 0)
)
)
diff --git a/test/lit/passes/gufa-refs.wast b/test/lit/passes/gufa-refs.wast
index d8fb51e50..73201a169 100644
--- a/test/lit/passes/gufa-refs.wast
+++ b/test/lit/passes/gufa-refs.wast
@@ -2961,7 +2961,7 @@
;; CHECK: (memory $0 10)
- ;; CHECK: (table $t 0 anyref)
+ ;; CHECK: (table $t 0 externref)
;; CHECK: (tag $e-i32 (param i32))
(tag $e-i32 (param i32))
@@ -3210,7 +3210,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (table.grow $t
- ;; CHECK-NEXT: (ref.null any)
+ ;; CHECK-NEXT: (ref.null extern)
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
diff --git a/test/lit/passes/instrument-locals_all-features_disable-typed-function-references.wast b/test/lit/passes/instrument-locals_all-features_disable-typed-function-references.wast
index 3c0ded9ee..70ccf3364 100644
--- a/test/lit/passes/instrument-locals_all-features_disable-typed-function-references.wast
+++ b/test/lit/passes/instrument-locals_all-features_disable-typed-function-references.wast
@@ -14,7 +14,7 @@
;; CHECK: (type $i32_i32_funcref_=>_funcref (func (param i32 i32 funcref) (result funcref)))
- ;; CHECK: (type $i32_i32_anyref_=>_anyref (func (param i32 i32 anyref) (result anyref)))
+ ;; CHECK: (type $i32_i32_externref_=>_externref (func (param i32 i32 externref) (result externref)))
;; CHECK: (type $i32_i32_v128_=>_v128 (func (param i32 i32 v128) (result v128)))
@@ -40,9 +40,9 @@
;; CHECK: (import "env" "set_funcref" (func $set_funcref (param i32 i32 funcref) (result funcref)))
- ;; CHECK: (import "env" "get_anyref" (func $get_anyref (param i32 i32 anyref) (result anyref)))
+ ;; CHECK: (import "env" "get_externref" (func $get_externref (param i32 i32 externref) (result externref)))
- ;; CHECK: (import "env" "set_anyref" (func $set_anyref (param i32 i32 anyref) (result anyref)))
+ ;; CHECK: (import "env" "set_externref" (func $set_externref (param i32 i32 externref) (result externref)))
;; CHECK: (import "env" "get_v128" (func $get_v128 (param i32 i32 v128) (result v128)))
@@ -56,7 +56,7 @@
;; CHECK-NEXT: (local $z f32)
;; CHECK-NEXT: (local $w f64)
;; CHECK-NEXT: (local $F funcref)
- ;; CHECK-NEXT: (local $X anyref)
+ ;; CHECK-NEXT: (local $X externref)
;; CHECK-NEXT: (local $S v128)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (call $get_i32
@@ -90,7 +90,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (call $get_anyref
+ ;; CHECK-NEXT: (call $get_externref
;; CHECK-NEXT: (i32.const 4)
;; CHECK-NEXT: (i32.const 5)
;; CHECK-NEXT: (local.get $X)
@@ -128,7 +128,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (call $get_anyref
+ ;; CHECK-NEXT: (call $get_externref
;; CHECK-NEXT: (i32.const 9)
;; CHECK-NEXT: (i32.const 5)
;; CHECK-NEXT: (local.get $X)
@@ -162,10 +162,10 @@
;; CHECK-NEXT: (ref.func $test)
;; CHECK-NEXT: )
;; CHECK-NEXT: (local.set $X
- ;; CHECK-NEXT: (call $set_anyref
+ ;; CHECK-NEXT: (call $set_externref
;; CHECK-NEXT: (i32.const 14)
;; CHECK-NEXT: (i32.const 5)
- ;; CHECK-NEXT: (call $get_anyref
+ ;; CHECK-NEXT: (call $get_externref
;; CHECK-NEXT: (i32.const 13)
;; CHECK-NEXT: (i32.const 5)
;; CHECK-NEXT: (local.get $X)
@@ -208,10 +208,10 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (local.set $X
- ;; CHECK-NEXT: (call $set_anyref
+ ;; CHECK-NEXT: (call $set_externref
;; CHECK-NEXT: (i32.const 21)
;; CHECK-NEXT: (i32.const 5)
- ;; CHECK-NEXT: (call $get_anyref
+ ;; CHECK-NEXT: (call $get_externref
;; CHECK-NEXT: (i32.const 20)
;; CHECK-NEXT: (i32.const 5)
;; CHECK-NEXT: (local.get $X)
diff --git a/test/lit/passes/optimize-instructions-gc.wast b/test/lit/passes/optimize-instructions-gc.wast
index f6a1b5d09..7a0eea294 100644
--- a/test/lit/passes/optimize-instructions-gc.wast
+++ b/test/lit/passes/optimize-instructions-gc.wast
@@ -47,37 +47,37 @@
;; These functions test if an `if` with subtyped arms is correctly folded
;; 1. if its `ifTrue` and `ifFalse` arms are identical (can fold)
;; CHECK: (func $if-arms-subtype-fold (result anyref)
- ;; CHECK-NEXT: (ref.null any)
+ ;; CHECK-NEXT: (ref.null eq)
;; CHECK-NEXT: )
;; NOMNL: (func $if-arms-subtype-fold (type $none_=>_anyref) (result anyref)
- ;; NOMNL-NEXT: (ref.null any)
+ ;; NOMNL-NEXT: (ref.null eq)
;; NOMNL-NEXT: )
(func $if-arms-subtype-fold (result anyref)
(if (result anyref)
(i32.const 0)
- (ref.null extern)
- (ref.null extern)
+ (ref.null eq)
+ (ref.null eq)
)
)
;; 2. if its `ifTrue` and `ifFalse` arms are not identical (cannot fold)
;; CHECK: (func $if-arms-subtype-nofold (result anyref)
;; CHECK-NEXT: (if (result anyref)
;; CHECK-NEXT: (i32.const 0)
- ;; CHECK-NEXT: (ref.null any)
+ ;; CHECK-NEXT: (ref.null eq)
;; CHECK-NEXT: (ref.null func)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; NOMNL: (func $if-arms-subtype-nofold (type $none_=>_anyref) (result anyref)
;; NOMNL-NEXT: (if (result anyref)
;; NOMNL-NEXT: (i32.const 0)
- ;; NOMNL-NEXT: (ref.null any)
+ ;; NOMNL-NEXT: (ref.null eq)
;; NOMNL-NEXT: (ref.null func)
;; NOMNL-NEXT: )
;; NOMNL-NEXT: )
(func $if-arms-subtype-nofold (result anyref)
(if (result anyref)
(i32.const 0)
- (ref.null extern)
+ (ref.null eq)
(ref.null func)
)
)
diff --git a/test/multi-table.wast.from-wast b/test/multi-table.wast.from-wast
index 545bb9c56..73a9abea3 100644
--- a/test/multi-table.wast.from-wast
+++ b/test/multi-table.wast.from-wast
@@ -5,7 +5,7 @@
(global $g2 i32 (i32.const 0))
(table $t2 3 3 funcref)
(table $t3 4 4 funcref)
- (table $textern 0 anyref)
+ (table $textern 0 externref)
(table $tspecial 5 5 (ref null $none_=>_none))
(elem $0 (table $t1) (i32.const 0) func $f)
(elem $1 (table $t2) (i32.const 0) func $f)
diff --git a/test/multi-table.wast.fromBinary b/test/multi-table.wast.fromBinary
index 105706621..427fb44f3 100644
--- a/test/multi-table.wast.fromBinary
+++ b/test/multi-table.wast.fromBinary
@@ -5,7 +5,7 @@
(global $g2 i32 (i32.const 0))
(table $t2 3 3 funcref)
(table $t3 4 4 funcref)
- (table $textern 0 anyref)
+ (table $textern 0 externref)
(table $tspecial 5 5 (ref null $none_=>_none))
(elem $0 (table $t1) (i32.const 0) func $f)
(elem $1 (table $t2) (i32.const 0) func $f)
diff --git a/test/multi-table.wast.fromBinary.noDebugInfo b/test/multi-table.wast.fromBinary.noDebugInfo
index 174d2a912..7fc667087 100644
--- a/test/multi-table.wast.fromBinary.noDebugInfo
+++ b/test/multi-table.wast.fromBinary.noDebugInfo
@@ -5,7 +5,7 @@
(global $global$1 i32 (i32.const 0))
(table $0 3 3 funcref)
(table $1 4 4 funcref)
- (table $2 0 anyref)
+ (table $2 0 externref)
(table $3 5 5 (ref null $none_=>_none))
(elem $0 (table $timport$0) (i32.const 0) func $0)
(elem $1 (table $0) (i32.const 0) func $0)
diff --git a/test/multivalue.wast.from-wast b/test/multivalue.wast.from-wast
index c6aa020dd..9340c183a 100644
--- a/test/multivalue.wast.from-wast
+++ b/test/multivalue.wast.from-wast
@@ -3,7 +3,7 @@
(type $none_=>_none (func))
(type $none_=>_i64 (func (result i64)))
(type $none_=>_f32_i64_i32 (func (result f32 i64 i32)))
- (type $none_=>_i32_i64_anyref (func (result i32 i64 anyref)))
+ (type $none_=>_i32_i64_externref (func (result i32 i64 externref)))
(type $none_=>_i32_i64_f32 (func (result i32 i64 f32)))
(type $none_=>_i32 (func (result i32)))
(type $none_=>_f32 (func (result f32)))
@@ -135,18 +135,18 @@
)
)
)
- (func $mv-if (result i32 i64 anyref)
- (if (result i32 i64 anyref)
+ (func $mv-if (result i32 i64 externref)
+ (if (result i32 i64 externref)
(i32.const 1)
(tuple.make
(i32.const 42)
(i64.const 42)
- (ref.null any)
+ (ref.null extern)
)
(tuple.make
(i32.const 42)
(i64.const 42)
- (ref.null any)
+ (ref.null extern)
)
)
)
diff --git a/test/multivalue.wast.fromBinary b/test/multivalue.wast.fromBinary
index cc900e024..dd39d4b34 100644
--- a/test/multivalue.wast.fromBinary
+++ b/test/multivalue.wast.fromBinary
@@ -1,7 +1,7 @@
(module
(type $none_=>_i32_i64 (func (result i32 i64)))
(type $none_=>_none (func))
- (type $none_=>_i32_i64_anyref (func (result i32 i64 anyref)))
+ (type $none_=>_i32_i64_externref (func (result i32 i64 externref)))
(type $none_=>_i64 (func (result i64)))
(type $none_=>_f32_i64_i32 (func (result f32 i64 i32)))
(type $none_=>_i32_i64_f32 (func (result i32 i64 f32)))
@@ -389,20 +389,20 @@
)
)
)
- (func $mv-if (result i32 i64 anyref)
- (local $0 (i32 i64 anyref))
+ (func $mv-if (result i32 i64 externref)
+ (local $0 (i32 i64 externref))
(local.set $0
- (if (result i32 i64 anyref)
+ (if (result i32 i64 externref)
(i32.const 1)
(tuple.make
(i32.const 42)
(i64.const 42)
- (ref.null any)
+ (ref.null extern)
)
(tuple.make
(i32.const 42)
(i64.const 42)
- (ref.null any)
+ (ref.null extern)
)
)
)
diff --git a/test/multivalue.wast.fromBinary.noDebugInfo b/test/multivalue.wast.fromBinary.noDebugInfo
index daf0a743e..66c0f52c5 100644
--- a/test/multivalue.wast.fromBinary.noDebugInfo
+++ b/test/multivalue.wast.fromBinary.noDebugInfo
@@ -1,7 +1,7 @@
(module
(type $none_=>_i32_i64 (func (result i32 i64)))
(type $none_=>_none (func))
- (type $none_=>_i32_i64_anyref (func (result i32 i64 anyref)))
+ (type $none_=>_i32_i64_externref (func (result i32 i64 externref)))
(type $none_=>_i64 (func (result i64)))
(type $none_=>_f32_i64_i32 (func (result f32 i64 i32)))
(type $none_=>_i32_i64_f32 (func (result i32 i64 f32)))
@@ -389,20 +389,20 @@
)
)
)
- (func $14 (result i32 i64 anyref)
- (local $0 (i32 i64 anyref))
+ (func $14 (result i32 i64 externref)
+ (local $0 (i32 i64 externref))
(local.set $0
- (if (result i32 i64 anyref)
+ (if (result i32 i64 externref)
(i32.const 1)
(tuple.make
(i32.const 42)
(i64.const 42)
- (ref.null any)
+ (ref.null extern)
)
(tuple.make
(i32.const 42)
(i64.const 42)
- (ref.null any)
+ (ref.null extern)
)
)
)
diff --git a/test/passes/precompute_all-features.txt b/test/passes/precompute_all-features.txt
index 70c790484..89d334a93 100644
--- a/test/passes/precompute_all-features.txt
+++ b/test/passes/precompute_all-features.txt
@@ -5,7 +5,7 @@
(type $0 (func (param i32)))
(type $none_=>_v128 (func (result v128)))
(type $none_=>_i32_i64 (func (result i32 i64)))
- (type $none_=>_anyref (func (result anyref)))
+ (type $none_=>_externref (func (result externref)))
(global $global i32 (i32.const 1))
(global $global-mut (mut i32) (i32.const 2))
(memory $0 512 512)
@@ -253,8 +253,8 @@
(func $loop-precompute (result i32)
(i32.const 1)
)
- (func $reftype-test (result anyref)
- (ref.null any)
+ (func $reftype-test (result externref)
+ (ref.null extern)
)
(func $dummy
(nop)
@@ -276,18 +276,18 @@
)
)
(drop
- (block $l2 (result anyref)
+ (block $l2 (result externref)
(drop
(block $l3
(global.set $global-mut
(i32.const 1)
)
(br $l2
- (ref.null any)
+ (ref.null extern)
)
)
)
- (ref.null any)
+ (ref.null extern)
)
)
(drop
diff --git a/test/passes/simplify-globals_all-features.txt b/test/passes/simplify-globals_all-features.txt
index 5ad54b0a8..ace056aac 100644
--- a/test/passes/simplify-globals_all-features.txt
+++ b/test/passes/simplify-globals_all-features.txt
@@ -213,9 +213,9 @@
)
(module
(type $none_=>_none (func))
- (import "env" "global-1" (global $g1 anyref))
- (global $g2 anyref (global.get $g1))
- (global $g3 anyref (ref.null any))
+ (import "env" "global-1" (global $g1 externref))
+ (global $g2 externref (global.get $g1))
+ (global $g3 externref (ref.null extern))
(func $test1
(drop
(global.get $g1)
@@ -226,7 +226,7 @@
)
(func $test2
(drop
- (ref.null any)
+ (ref.null extern)
)
)
)
diff --git a/test/passes/simplify-locals_all-features.txt b/test/passes/simplify-locals_all-features.txt
index 0c25ea54b..d4338870d 100644
--- a/test/passes/simplify-locals_all-features.txt
+++ b/test/passes/simplify-locals_all-features.txt
@@ -1884,7 +1884,7 @@
(module
(type $none_=>_anyref (func (result anyref)))
(func $subtype-test (result anyref)
- (local $0 anyref)
+ (local $0 eqref)
(local $1 anyref)
(local $2 anyref)
(block $block
diff --git a/test/passes/simplify-locals_all-features.wast b/test/passes/simplify-locals_all-features.wast
index 7d153efd9..ff70a2774 100644
--- a/test/passes/simplify-locals_all-features.wast
+++ b/test/passes/simplify-locals_all-features.wast
@@ -1657,7 +1657,7 @@
)
(module
(func $subtype-test (result anyref)
- (local $0 externref)
+ (local $0 eqref)
(local $1 anyref)
(local $2 anyref)
(block
diff --git a/test/passes/strip-target-features_roundtrip_print-features_all-features.txt b/test/passes/strip-target-features_roundtrip_print-features_all-features.txt
index fa7221683..994453007 100644
--- a/test/passes/strip-target-features_roundtrip_print-features_all-features.txt
+++ b/test/passes/strip-target-features_roundtrip_print-features_all-features.txt
@@ -15,14 +15,14 @@
--enable-extended-const
--enable-strings
(module
- (type $none_=>_v128_anyref (func (result v128 anyref)))
- (func $foo (result v128 anyref)
+ (type $none_=>_v128_externref (func (result v128 externref)))
+ (func $foo (result v128 externref)
(tuple.make
(v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000)
- (ref.null any)
+ (ref.null extern)
)
)
- (func $bar (result v128 anyref)
+ (func $bar (result v128 externref)
(return_call $foo)
)
)
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 aac1cbc83..5e4beae81 100644
--- a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt
+++ b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt
@@ -1,6 +1,6 @@
total
- [exports] : 10
- [funcs] : 12
+ [exports] : 9
+ [funcs] : 13
[globals] : 6
[imports] : 5
[memories] : 1
@@ -8,34 +8,33 @@ total
[table-data] : 4
[tables] : 1
[tags] : 0
- [total] : 549
- [vars] : 22
- AtomicCmpxchg : 1
- AtomicFence : 1
- Binary : 71
- Block : 60
- Break : 2
- Call : 23
- CallRef : 2
- Const : 119
- Drop : 3
- GlobalGet : 35
- GlobalSet : 19
- I31New : 6
- If : 25
- Load : 16
- LocalGet : 45
- LocalSet : 23
- Loop : 6
- Nop : 7
- RefFunc : 11
+ [total] : 669
+ [vars] : 20
+ ArrayInit : 3
+ AtomicCmpxchg : 2
+ Binary : 75
+ Block : 81
+ Break : 8
+ Call : 44
+ CallRef : 1
+ Const : 137
+ Drop : 10
+ GlobalGet : 41
+ GlobalSet : 22
+ I31New : 8
+ If : 31
+ Load : 18
+ LocalGet : 48
+ LocalSet : 27
+ Loop : 8
+ Nop : 12
+ RefFunc : 10
RefIs : 1
- RefNull : 2
+ RefNull : 4
Return : 27
- SIMDExtract : 1
Select : 1
- Store : 3
- StructNew : 2
- TupleMake : 7
- Unary : 29
- Unreachable : 1
+ Store : 1
+ StructNew : 7
+ TupleExtract : 1
+ TupleMake : 6
+ Unary : 35
diff --git a/test/reference-types.wast b/test/reference-types.wast
index afdb38c89..a7f84a93c 100644
--- a/test/reference-types.wast
+++ b/test/reference-types.wast
@@ -1,51 +1,43 @@
-;; 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.
-;;
-;; reftype :: reftype | anyref
-;; reftype <: anyref
-
(module
- (type $sig_externref (func (param externref)))
+ (type $sig_eqref (func (param eqref)))
(type $sig_funcref (func (param funcref)))
(type $sig_anyref (func (param anyref)))
- (func $take_externref (param externref))
+ (func $take_eqref (param eqref))
(func $take_funcref (param funcref))
(func $take_anyref (param anyref))
(func $foo)
- (table funcref (elem $take_externref $take_funcref $take_anyref))
+ (table funcref (elem $take_eqref $take_funcref $take_anyref))
(elem declare func $ref-taken-but-not-in-table)
- (import "env" "import_func" (func $import_func (param externref) (result funcref)))
- (import "env" "import_global" (global $import_global externref))
- (export "export_func" (func $import_func (param externref) (result funcref)))
+ (import "env" "import_func" (func $import_func (param eqref) (result funcref)))
+ (import "env" "import_global" (global $import_global eqref))
+ (export "export_func" (func $import_func (param eqref) (result funcref)))
(export "export_global" (global $import_global))
;; Test global initializer expressions
- (global $global_externref (mut externref) (ref.null extern))
+ (global $global_eqref (mut eqref) (ref.null eq))
(global $global_funcref (mut funcref) (ref.null func))
(global $global_funcref_func (mut funcref) (ref.func $foo))
(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_anyref2 (mut anyref) (ref.null eq))
(global $global_anyref3 (mut anyref) (ref.null func))
(global $global_anyref4 (mut anyref) (ref.func $foo))
(tag $e-i32 (param i32))
(func $test
- (local $local_externref externref)
+ (local $local_eqref eqref)
(local $local_funcref funcref)
(local $local_anyref anyref)
;; Test types for local.get/set
- (local.set $local_externref (local.get $local_externref))
- (local.set $local_externref (global.get $global_externref))
- (local.set $local_externref (ref.null extern))
+ (local.set $local_eqref (local.get $local_eqref))
+ (local.set $local_eqref (global.get $global_eqref))
+ (local.set $local_eqref (ref.null eq))
(local.set $local_funcref (local.get $local_funcref))
(local.set $local_funcref (global.get $global_funcref))
(local.set $local_funcref (ref.null func))
@@ -55,18 +47,18 @@
(local.set $local_anyref (ref.null any))
;; Test subtype relationship for local.set
- (local.set $local_anyref (local.get $local_externref))
- (local.set $local_anyref (global.get $global_externref))
- (local.set $local_anyref (ref.null extern))
+ (local.set $local_anyref (local.get $local_eqref))
+ (local.set $local_anyref (global.get $global_eqref))
+ (local.set $local_anyref (ref.null eq))
(local.set $local_anyref (local.get $local_funcref))
(local.set $local_anyref (global.get $global_funcref))
(local.set $local_anyref (ref.null func))
(local.set $local_anyref (ref.func $foo))
;; Test types for global.get/set
- (global.set $global_externref (global.get $global_externref))
- (global.set $global_externref (local.get $local_externref))
- (global.set $global_externref (ref.null extern))
+ (global.set $global_eqref (global.get $global_eqref))
+ (global.set $global_eqref (local.get $local_eqref))
+ (global.set $global_eqref (ref.null eq))
(global.set $global_funcref (global.get $global_funcref))
(global.set $global_funcref (local.get $local_funcref))
(global.set $global_funcref (ref.null func))
@@ -76,18 +68,18 @@
(global.set $global_anyref (ref.null any))
;; Test subtype relationship for global.set
- (global.set $global_anyref (global.get $global_externref))
- (global.set $global_anyref (local.get $local_externref))
- (global.set $global_anyref (ref.null extern))
+ (global.set $global_anyref (global.get $global_eqref))
+ (global.set $global_anyref (local.get $local_eqref))
+ (global.set $global_anyref (ref.null eq))
(global.set $global_anyref (global.get $global_funcref))
(global.set $global_anyref (local.get $local_funcref))
(global.set $global_anyref (ref.null func))
(global.set $global_anyref (ref.func $foo))
;; Test function call params
- (call $take_externref (local.get $local_externref))
- (call $take_externref (global.get $global_externref))
- (call $take_externref (ref.null extern))
+ (call $take_eqref (local.get $local_eqref))
+ (call $take_eqref (global.get $global_eqref))
+ (call $take_eqref (ref.null eq))
(call $take_funcref (local.get $local_funcref))
(call $take_funcref (global.get $global_funcref))
(call $take_funcref (ref.null func))
@@ -97,18 +89,18 @@
(call $take_anyref (ref.null any))
;; Test subtype relationship for function call params
- (call $take_anyref (local.get $local_externref))
- (call $take_anyref (global.get $global_externref))
- (call $take_anyref (ref.null extern))
+ (call $take_anyref (local.get $local_eqref))
+ (call $take_anyref (global.get $global_eqref))
+ (call $take_anyref (ref.null eq))
(call $take_anyref (local.get $local_funcref))
(call $take_anyref (global.get $global_funcref))
(call $take_anyref (ref.null func))
(call $take_anyref (ref.func $foo))
;; Test call_indirect params
- (call_indirect (type $sig_externref) (local.get $local_externref) (i32.const 0))
- (call_indirect (type $sig_externref) (global.get $global_externref) (i32.const 0))
- (call_indirect (type $sig_externref) (ref.null extern) (i32.const 0))
+ (call_indirect (type $sig_eqref) (local.get $local_eqref) (i32.const 0))
+ (call_indirect (type $sig_eqref) (global.get $global_eqref) (i32.const 0))
+ (call_indirect (type $sig_eqref) (ref.null eq) (i32.const 0))
(call_indirect (type $sig_funcref) (local.get $local_funcref) (i32.const 1))
(call_indirect (type $sig_funcref) (global.get $global_funcref) (i32.const 1))
(call_indirect (type $sig_funcref) (ref.null func) (i32.const 1))
@@ -118,9 +110,9 @@
(call_indirect (type $sig_anyref) (ref.null any) (i32.const 3))
;; Test subtype relationship for call_indirect params
- (call_indirect (type $sig_anyref) (local.get $local_externref) (i32.const 3))
- (call_indirect (type $sig_anyref) (global.get $global_externref) (i32.const 3))
- (call_indirect (type $sig_anyref) (ref.null extern) (i32.const 3))
+ (call_indirect (type $sig_anyref) (local.get $local_eqref) (i32.const 3))
+ (call_indirect (type $sig_anyref) (global.get $global_eqref) (i32.const 3))
+ (call_indirect (type $sig_anyref) (ref.null eq) (i32.const 3))
(call_indirect (type $sig_anyref) (local.get $local_funcref) (i32.const 3))
(call_indirect (type $sig_anyref) (global.get $global_funcref) (i32.const 3))
(call_indirect (type $sig_anyref) (ref.null func) (i32.const 3))
@@ -128,18 +120,18 @@
;; Test block return type
(drop
- (block (result externref)
- (br_if 0 (local.get $local_externref) (i32.const 1))
+ (block (result eqref)
+ (br_if 0 (local.get $local_eqref) (i32.const 1))
)
)
(drop
- (block (result externref)
- (br_if 0 (global.get $global_externref) (i32.const 1))
+ (block (result eqref)
+ (br_if 0 (global.get $global_eqref) (i32.const 1))
)
)
(drop
- (block (result externref)
- (br_if 0 (ref.null extern) (i32.const 1))
+ (block (result eqref)
+ (br_if 0 (ref.null eq) (i32.const 1))
)
)
(drop
@@ -181,7 +173,7 @@
;; Test subtype relationship for block return type
(drop
(block (result anyref)
- (br_if 0 (local.get $local_externref) (i32.const 1))
+ (br_if 0 (local.get $local_eqref) (i32.const 1))
)
)
(drop
@@ -191,7 +183,7 @@
)
(drop
(block (result anyref)
- (br_if 0 (ref.null extern) (i32.const 1))
+ (br_if 0 (ref.null eq) (i32.const 1))
)
)
(drop
@@ -207,18 +199,18 @@
;; Test loop return type
(drop
- (loop (result externref)
- (local.get $local_externref)
+ (loop (result eqref)
+ (local.get $local_eqref)
)
)
(drop
- (loop (result externref)
- (global.get $global_externref)
+ (loop (result eqref)
+ (global.get $global_eqref)
)
)
(drop
- (loop (result externref)
- (ref.null extern)
+ (loop (result eqref)
+ (ref.null eq)
)
)
(drop
@@ -260,17 +252,17 @@
;; Test subtype relationship for loop return type
(drop
(loop (result anyref)
- (local.get $local_externref)
+ (local.get $local_eqref)
)
)
(drop
(loop (result anyref)
- (global.get $global_externref)
+ (global.get $global_eqref)
)
)
(drop
(loop (result anyref)
- (ref.null extern)
+ (ref.null eq)
)
)
(drop
@@ -296,10 +288,10 @@
;; Test if return type
(drop
- (if (result externref)
+ (if (result eqref)
(i32.const 1)
- (local.get $local_externref)
- (ref.null extern)
+ (local.get $local_eqref)
+ (ref.null eq)
)
)
(drop
@@ -321,14 +313,14 @@
(drop
(if (result anyref)
(i32.const 1)
- (local.get $local_externref)
+ (local.get $local_eqref)
(local.get $local_funcref)
)
)
(drop
(if (result anyref)
(i32.const 1)
- (ref.null extern)
+ (ref.null eq)
(ref.null func)
)
)
@@ -336,19 +328,19 @@
(if (result anyref)
(i32.const 1)
(ref.func $foo)
- (ref.null extern)
+ (ref.null eq)
)
)
;; Test try return type
(drop
- (try (result externref)
+ (try (result eqref)
(do
- (local.get $local_externref)
+ (local.get $local_eqref)
)
(catch $e-i32
(drop (pop i32))
- (ref.null extern)
+ (ref.null eq)
)
)
)
@@ -368,7 +360,7 @@
(drop
(try (result anyref)
(do
- (local.get $local_externref)
+ (local.get $local_eqref)
)
(catch $e-i32
(drop (pop i32))
@@ -383,16 +375,16 @@
)
(catch $e-i32
(drop (pop i32))
- (local.get $local_externref)
+ (local.get $local_eqref)
)
)
)
;; Test typed select
(drop
- (select (result externref)
- (local.get $local_externref)
- (ref.null extern)
+ (select (result eqref)
+ (local.get $local_eqref)
+ (ref.null eq)
(i32.const 1)
)
)
@@ -414,7 +406,7 @@
;; Test subtype relationship for typed select
(drop
(select (result anyref)
- (local.get $local_externref)
+ (local.get $local_eqref)
(local.get $local_funcref)
(i32.const 1)
)
@@ -422,15 +414,15 @@
(drop
(select (result anyref)
(local.get $local_funcref)
- (local.get $local_externref)
+ (local.get $local_eqref)
(i32.const 1)
)
)
;; ref.is_null takes any reference types
- (drop (ref.is_null (local.get $local_externref)))
- (drop (ref.is_null (global.get $global_externref)))
- (drop (ref.is_null (ref.null extern)))
+ (drop (ref.is_null (local.get $local_eqref)))
+ (drop (ref.is_null (global.get $global_eqref)))
+ (drop (ref.is_null (ref.null eq)))
(drop (ref.is_null (local.get $local_funcref)))
(drop (ref.is_null (global.get $global_funcref)))
(drop (ref.is_null (ref.null func)))
@@ -441,15 +433,15 @@
)
;; Test function return type
- (func $return_externref_local (result externref)
- (local $local_externref externref)
- (local.get $local_externref)
+ (func $return_eqref_local (result eqref)
+ (local $local_eqref eqref)
+ (local.get $local_eqref)
)
- (func $return_externref_global (result externref)
- (global.get $global_externref)
+ (func $return_eqref_global (result eqref)
+ (global.get $global_eqref)
)
- (func $return_externref_null (result externref)
- (ref.null extern)
+ (func $return_eqref_null (result eqref)
+ (ref.null eq)
)
(func $return_funcref_local (result funcref)
(local $local_funcref funcref)
@@ -477,14 +469,14 @@
;; Test subtype relationship in function return type
(func $return_anyref2 (result anyref)
- (local $local_externref externref)
- (local.get $local_externref)
+ (local $local_eqref eqref)
+ (local.get $local_eqref)
)
(func $return_anyref3 (result anyref)
- (global.get $global_externref)
+ (global.get $global_eqref)
)
(func $return_anyref4 (result anyref)
- (ref.null extern)
+ (ref.null eq)
)
(func $return_anyref5 (result anyref)
(local $local_funcref funcref)
@@ -501,11 +493,11 @@
)
;; Test returns
- (func $returns_externref (result externref)
- (local $local_externref externref)
- (return (local.get $local_externref))
- (return (global.get $global_externref))
- (return (ref.null extern))
+ (func $returns_eqref (result eqref)
+ (local $local_eqref eqref)
+ (return (local.get $local_eqref))
+ (return (global.get $global_eqref))
+ (return (ref.null eq))
)
(func $returns_funcref (result funcref)
(local $local_funcref funcref)
@@ -523,11 +515,11 @@
;; Test subtype relationship in returns
(func $returns_anyref2 (result anyref)
- (local $local_externref externref)
+ (local $local_eqref eqref)
(local $local_funcref funcref)
- (return (local.get $local_externref))
- (return (global.get $global_externref))
- (return (ref.null extern))
+ (return (local.get $local_eqref))
+ (return (global.get $global_eqref))
+ (return (ref.null eq))
(return (local.get $local_funcref))
(return (global.get $global_funcref))
(return (ref.func $foo))
diff --git a/test/reference-types.wast.from-wast b/test/reference-types.wast.from-wast
index 5afb74eda..47f1b9893 100644
--- a/test/reference-types.wast.from-wast
+++ b/test/reference-types.wast.from-wast
@@ -3,25 +3,27 @@
(type $sig_anyref (func (param anyref)))
(type $sig_funcref (func (param funcref)))
(type $none_=>_funcref (func (result funcref)))
+ (type $sig_eqref (func (param eqref)))
(type $none_=>_none (func))
+ (type $none_=>_eqref (func (result eqref)))
(type $i32_=>_none (func (param i32)))
- (type $anyref_=>_funcref (func (param anyref) (result funcref)))
- (import "env" "import_global" (global $import_global anyref))
- (import "env" "import_func" (func $import_func (param anyref) (result funcref)))
- (global $global_externref (mut anyref) (ref.null any))
+ (type $eqref_=>_funcref (func (param eqref) (result funcref)))
+ (import "env" "import_global" (global $import_global eqref))
+ (import "env" "import_func" (func $import_func (param eqref) (result funcref)))
+ (global $global_eqref (mut eqref) (ref.null eq))
(global $global_funcref (mut funcref) (ref.null func))
(global $global_funcref_func (mut funcref) (ref.func $foo))
(global $global_anyref (mut anyref) (ref.null any))
- (global $global_anyref2 (mut anyref) (ref.null any))
+ (global $global_anyref2 (mut anyref) (ref.null eq))
(global $global_anyref3 (mut anyref) (ref.null func))
(global $global_anyref4 (mut anyref) (ref.func $foo))
(table $0 3 3 funcref)
- (elem (i32.const 0) $take_externref $take_funcref $take_anyref)
+ (elem (i32.const 0) $take_eqref $take_funcref $take_anyref)
(elem declare func $foo $ref-taken-but-not-in-table)
(tag $e-i32 (param i32))
(export "export_func" (func $import_func))
(export "export_global" (global $import_global))
- (func $take_externref (param $0 anyref)
+ (func $take_eqref (param $0 eqref)
(nop)
)
(func $take_funcref (param $0 funcref)
@@ -34,17 +36,17 @@
(nop)
)
(func $test
- (local $local_externref anyref)
+ (local $local_eqref eqref)
(local $local_funcref funcref)
(local $local_anyref anyref)
- (local.set $local_externref
- (local.get $local_externref)
+ (local.set $local_eqref
+ (local.get $local_eqref)
)
- (local.set $local_externref
- (global.get $global_externref)
+ (local.set $local_eqref
+ (global.get $global_eqref)
)
- (local.set $local_externref
- (ref.null any)
+ (local.set $local_eqref
+ (ref.null eq)
)
(local.set $local_funcref
(local.get $local_funcref)
@@ -68,13 +70,13 @@
(ref.null any)
)
(local.set $local_anyref
- (local.get $local_externref)
+ (local.get $local_eqref)
)
(local.set $local_anyref
- (global.get $global_externref)
+ (global.get $global_eqref)
)
(local.set $local_anyref
- (ref.null any)
+ (ref.null eq)
)
(local.set $local_anyref
(local.get $local_funcref)
@@ -88,14 +90,14 @@
(local.set $local_anyref
(ref.func $foo)
)
- (global.set $global_externref
- (global.get $global_externref)
+ (global.set $global_eqref
+ (global.get $global_eqref)
)
- (global.set $global_externref
- (local.get $local_externref)
+ (global.set $global_eqref
+ (local.get $local_eqref)
)
- (global.set $global_externref
- (ref.null any)
+ (global.set $global_eqref
+ (ref.null eq)
)
(global.set $global_funcref
(global.get $global_funcref)
@@ -119,13 +121,13 @@
(ref.null any)
)
(global.set $global_anyref
- (global.get $global_externref)
+ (global.get $global_eqref)
)
(global.set $global_anyref
- (local.get $local_externref)
+ (local.get $local_eqref)
)
(global.set $global_anyref
- (ref.null any)
+ (ref.null eq)
)
(global.set $global_anyref
(global.get $global_funcref)
@@ -139,14 +141,14 @@
(global.set $global_anyref
(ref.func $foo)
)
- (call $take_externref
- (local.get $local_externref)
+ (call $take_eqref
+ (local.get $local_eqref)
)
- (call $take_externref
- (global.get $global_externref)
+ (call $take_eqref
+ (global.get $global_eqref)
)
- (call $take_externref
- (ref.null any)
+ (call $take_eqref
+ (ref.null eq)
)
(call $take_funcref
(local.get $local_funcref)
@@ -170,13 +172,13 @@
(ref.null any)
)
(call $take_anyref
- (local.get $local_externref)
+ (local.get $local_eqref)
)
(call $take_anyref
- (global.get $global_externref)
+ (global.get $global_eqref)
)
(call $take_anyref
- (ref.null any)
+ (ref.null eq)
)
(call $take_anyref
(local.get $local_funcref)
@@ -190,16 +192,16 @@
(call $take_anyref
(ref.func $foo)
)
- (call_indirect $0 (type $sig_anyref)
- (local.get $local_externref)
+ (call_indirect $0 (type $sig_eqref)
+ (local.get $local_eqref)
(i32.const 0)
)
- (call_indirect $0 (type $sig_anyref)
- (global.get $global_externref)
+ (call_indirect $0 (type $sig_eqref)
+ (global.get $global_eqref)
(i32.const 0)
)
- (call_indirect $0 (type $sig_anyref)
- (ref.null any)
+ (call_indirect $0 (type $sig_eqref)
+ (ref.null eq)
(i32.const 0)
)
(call_indirect $0 (type $sig_funcref)
@@ -231,15 +233,15 @@
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
- (local.get $local_externref)
+ (local.get $local_eqref)
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
- (global.get $global_externref)
+ (global.get $global_eqref)
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
- (ref.null any)
+ (ref.null eq)
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
@@ -259,25 +261,25 @@
(i32.const 3)
)
(drop
- (block $block (result anyref)
+ (block $block (result eqref)
(br_if $block
- (local.get $local_externref)
+ (local.get $local_eqref)
(i32.const 1)
)
)
)
(drop
- (block $block0 (result anyref)
+ (block $block0 (result eqref)
(br_if $block0
- (global.get $global_externref)
+ (global.get $global_eqref)
(i32.const 1)
)
)
)
(drop
- (block $block1 (result anyref)
+ (block $block1 (result eqref)
(br_if $block1
- (ref.null any)
+ (ref.null eq)
(i32.const 1)
)
)
@@ -341,7 +343,7 @@
(drop
(block $block9 (result anyref)
(br_if $block9
- (local.get $local_externref)
+ (local.get $local_eqref)
(i32.const 1)
)
)
@@ -357,7 +359,7 @@
(drop
(block $block11 (result anyref)
(br_if $block11
- (ref.null any)
+ (ref.null eq)
(i32.const 1)
)
)
@@ -379,18 +381,18 @@
)
)
(drop
- (loop $loop-in (result anyref)
- (local.get $local_externref)
+ (loop $loop-in (result eqref)
+ (local.get $local_eqref)
)
)
(drop
- (loop $loop-in14 (result anyref)
- (global.get $global_externref)
+ (loop $loop-in14 (result eqref)
+ (global.get $global_eqref)
)
)
(drop
- (loop $loop-in15 (result anyref)
- (ref.null any)
+ (loop $loop-in15 (result eqref)
+ (ref.null eq)
)
)
(drop
@@ -430,17 +432,17 @@
)
(drop
(loop $loop-in23 (result anyref)
- (local.get $local_externref)
+ (local.get $local_eqref)
)
)
(drop
(loop $loop-in24 (result anyref)
- (global.get $global_externref)
+ (global.get $global_eqref)
)
)
(drop
(loop $loop-in25 (result anyref)
- (ref.null any)
+ (ref.null eq)
)
)
(drop
@@ -464,10 +466,10 @@
)
)
(drop
- (if (result anyref)
+ (if (result eqref)
(i32.const 1)
- (local.get $local_externref)
- (ref.null any)
+ (local.get $local_eqref)
+ (ref.null eq)
)
)
(drop
@@ -487,14 +489,14 @@
(drop
(if (result anyref)
(i32.const 1)
- (local.get $local_externref)
+ (local.get $local_eqref)
(local.get $local_funcref)
)
)
(drop
(if (result anyref)
(i32.const 1)
- (ref.null any)
+ (ref.null eq)
(ref.null func)
)
)
@@ -502,19 +504,19 @@
(if (result anyref)
(i32.const 1)
(ref.func $foo)
- (ref.null any)
+ (ref.null eq)
)
)
(drop
- (try $try (result anyref)
+ (try $try (result eqref)
(do
- (local.get $local_externref)
+ (local.get $local_eqref)
)
(catch $e-i32
(drop
(pop i32)
)
- (ref.null any)
+ (ref.null eq)
)
)
)
@@ -534,7 +536,7 @@
(drop
(try $try36 (result anyref)
(do
- (local.get $local_externref)
+ (local.get $local_eqref)
)
(catch $e-i32
(drop
@@ -553,14 +555,14 @@
(drop
(pop i32)
)
- (local.get $local_externref)
+ (local.get $local_eqref)
)
)
)
(drop
- (select (result anyref)
- (local.get $local_externref)
- (ref.null any)
+ (select (result eqref)
+ (local.get $local_eqref)
+ (ref.null eq)
(i32.const 1)
)
)
@@ -580,7 +582,7 @@
)
(drop
(select (result anyref)
- (local.get $local_externref)
+ (local.get $local_eqref)
(local.get $local_funcref)
(i32.const 1)
)
@@ -588,23 +590,23 @@
(drop
(select (result anyref)
(local.get $local_funcref)
- (local.get $local_externref)
+ (local.get $local_eqref)
(i32.const 1)
)
)
(drop
(ref.is_null
- (local.get $local_externref)
+ (local.get $local_eqref)
)
)
(drop
(ref.is_null
- (global.get $global_externref)
+ (global.get $global_eqref)
)
)
(drop
(ref.is_null
- (ref.null any)
+ (ref.null eq)
)
)
(drop
@@ -643,15 +645,15 @@
)
)
)
- (func $return_externref_local (result anyref)
- (local $local_externref anyref)
- (local.get $local_externref)
+ (func $return_eqref_local (result eqref)
+ (local $local_eqref eqref)
+ (local.get $local_eqref)
)
- (func $return_externref_global (result anyref)
- (global.get $global_externref)
+ (func $return_eqref_global (result eqref)
+ (global.get $global_eqref)
)
- (func $return_externref_null (result anyref)
- (ref.null any)
+ (func $return_eqref_null (result eqref)
+ (ref.null eq)
)
(func $return_funcref_local (result funcref)
(local $local_funcref funcref)
@@ -677,14 +679,14 @@
(ref.null any)
)
(func $return_anyref2 (result anyref)
- (local $local_externref anyref)
- (local.get $local_externref)
+ (local $local_eqref eqref)
+ (local.get $local_eqref)
)
(func $return_anyref3 (result anyref)
- (global.get $global_externref)
+ (global.get $global_eqref)
)
(func $return_anyref4 (result anyref)
- (ref.null any)
+ (ref.null eq)
)
(func $return_anyref5 (result anyref)
(local $local_funcref funcref)
@@ -699,16 +701,16 @@
(func $return_anyref8 (result anyref)
(ref.func $foo)
)
- (func $returns_externref (result anyref)
- (local $local_externref anyref)
+ (func $returns_eqref (result eqref)
+ (local $local_eqref eqref)
(return
- (local.get $local_externref)
+ (local.get $local_eqref)
)
(return
- (global.get $global_externref)
+ (global.get $global_eqref)
)
(return
- (ref.null any)
+ (ref.null eq)
)
)
(func $returns_funcref (result funcref)
@@ -739,16 +741,16 @@
)
)
(func $returns_anyref2 (result anyref)
- (local $local_externref anyref)
+ (local $local_eqref eqref)
(local $local_funcref funcref)
(return
- (local.get $local_externref)
+ (local.get $local_eqref)
)
(return
- (global.get $global_externref)
+ (global.get $global_eqref)
)
(return
- (ref.null any)
+ (ref.null eq)
)
(return
(local.get $local_funcref)
diff --git a/test/reference-types.wast.fromBinary b/test/reference-types.wast.fromBinary
index 37a57ac78..68ed3e63d 100644
--- a/test/reference-types.wast.fromBinary
+++ b/test/reference-types.wast.fromBinary
@@ -3,25 +3,27 @@
(type $sig_anyref (func (param anyref)))
(type $sig_funcref (func (param funcref)))
(type $none_=>_funcref (func (result funcref)))
+ (type $sig_eqref (func (param eqref)))
(type $none_=>_none (func))
+ (type $none_=>_eqref (func (result eqref)))
(type $i32_=>_none (func (param i32)))
- (type $anyref_=>_funcref (func (param anyref) (result funcref)))
- (import "env" "import_global" (global $import_global anyref))
- (import "env" "import_func" (func $import_func (param anyref) (result funcref)))
- (global $global_externref (mut anyref) (ref.null any))
+ (type $eqref_=>_funcref (func (param eqref) (result funcref)))
+ (import "env" "import_global" (global $import_global eqref))
+ (import "env" "import_func" (func $import_func (param eqref) (result funcref)))
+ (global $global_eqref (mut eqref) (ref.null eq))
(global $global_funcref (mut funcref) (ref.null func))
(global $global_funcref_func (mut funcref) (ref.func $foo))
(global $global_anyref (mut anyref) (ref.null any))
- (global $global_anyref2 (mut anyref) (ref.null any))
+ (global $global_anyref2 (mut anyref) (ref.null eq))
(global $global_anyref3 (mut anyref) (ref.null func))
(global $global_anyref4 (mut anyref) (ref.func $foo))
(table $0 3 3 funcref)
- (elem (i32.const 0) $take_externref $take_funcref $take_anyref)
+ (elem (i32.const 0) $take_eqref $take_funcref $take_anyref)
(elem declare func $foo $ref-taken-but-not-in-table)
(tag $tag$0 (param i32))
(export "export_func" (func $import_func))
(export "export_global" (global $import_global))
- (func $take_externref (param $0 anyref)
+ (func $take_eqref (param $0 eqref)
(nop)
)
(func $take_funcref (param $0 funcref)
@@ -34,17 +36,17 @@
(nop)
)
(func $test
- (local $local_externref anyref)
- (local $local_anyref anyref)
+ (local $local_eqref eqref)
(local $local_funcref funcref)
- (local.set $local_externref
- (local.get $local_externref)
+ (local $local_anyref anyref)
+ (local.set $local_eqref
+ (local.get $local_eqref)
)
- (local.set $local_externref
- (global.get $global_externref)
+ (local.set $local_eqref
+ (global.get $global_eqref)
)
- (local.set $local_externref
- (ref.null any)
+ (local.set $local_eqref
+ (ref.null eq)
)
(local.set $local_funcref
(local.get $local_funcref)
@@ -68,13 +70,13 @@
(ref.null any)
)
(local.set $local_anyref
- (local.get $local_externref)
+ (local.get $local_eqref)
)
(local.set $local_anyref
- (global.get $global_externref)
+ (global.get $global_eqref)
)
(local.set $local_anyref
- (ref.null any)
+ (ref.null eq)
)
(local.set $local_anyref
(local.get $local_funcref)
@@ -88,14 +90,14 @@
(local.set $local_anyref
(ref.func $foo)
)
- (global.set $global_externref
- (global.get $global_externref)
+ (global.set $global_eqref
+ (global.get $global_eqref)
)
- (global.set $global_externref
- (local.get $local_externref)
+ (global.set $global_eqref
+ (local.get $local_eqref)
)
- (global.set $global_externref
- (ref.null any)
+ (global.set $global_eqref
+ (ref.null eq)
)
(global.set $global_funcref
(global.get $global_funcref)
@@ -119,13 +121,13 @@
(ref.null any)
)
(global.set $global_anyref
- (global.get $global_externref)
+ (global.get $global_eqref)
)
(global.set $global_anyref
- (local.get $local_externref)
+ (local.get $local_eqref)
)
(global.set $global_anyref
- (ref.null any)
+ (ref.null eq)
)
(global.set $global_anyref
(global.get $global_funcref)
@@ -139,14 +141,14 @@
(global.set $global_anyref
(ref.func $foo)
)
- (call $take_externref
- (local.get $local_externref)
+ (call $take_eqref
+ (local.get $local_eqref)
)
- (call $take_externref
- (global.get $global_externref)
+ (call $take_eqref
+ (global.get $global_eqref)
)
- (call $take_externref
- (ref.null any)
+ (call $take_eqref
+ (ref.null eq)
)
(call $take_funcref
(local.get $local_funcref)
@@ -170,13 +172,13 @@
(ref.null any)
)
(call $take_anyref
- (local.get $local_externref)
+ (local.get $local_eqref)
)
(call $take_anyref
- (global.get $global_externref)
+ (global.get $global_eqref)
)
(call $take_anyref
- (ref.null any)
+ (ref.null eq)
)
(call $take_anyref
(local.get $local_funcref)
@@ -190,16 +192,16 @@
(call $take_anyref
(ref.func $foo)
)
- (call_indirect $0 (type $sig_anyref)
- (local.get $local_externref)
+ (call_indirect $0 (type $sig_eqref)
+ (local.get $local_eqref)
(i32.const 0)
)
- (call_indirect $0 (type $sig_anyref)
- (global.get $global_externref)
+ (call_indirect $0 (type $sig_eqref)
+ (global.get $global_eqref)
(i32.const 0)
)
- (call_indirect $0 (type $sig_anyref)
- (ref.null any)
+ (call_indirect $0 (type $sig_eqref)
+ (ref.null eq)
(i32.const 0)
)
(call_indirect $0 (type $sig_funcref)
@@ -231,15 +233,15 @@
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
- (local.get $local_externref)
+ (local.get $local_eqref)
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
- (global.get $global_externref)
+ (global.get $global_eqref)
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
- (ref.null any)
+ (ref.null eq)
(i32.const 3)
)
(call_indirect $0 (type $sig_anyref)
@@ -259,25 +261,25 @@
(i32.const 3)
)
(drop
- (block $label$1 (result anyref)
+ (block $label$1 (result eqref)
(br_if $label$1
- (local.get $local_externref)
+ (local.get $local_eqref)
(i32.const 1)
)
)
)
(drop
- (block $label$2 (result anyref)
+ (block $label$2 (result eqref)
(br_if $label$2
- (global.get $global_externref)
+ (global.get $global_eqref)
(i32.const 1)
)
)
)
(drop
- (block $label$3 (result anyref)
+ (block $label$3 (result eqref)
(br_if $label$3
- (ref.null any)
+ (ref.null eq)
(i32.const 1)
)
)
@@ -341,7 +343,7 @@
(drop
(block $label$11 (result anyref)
(br_if $label$11
- (local.get $local_externref)
+ (local.get $local_eqref)
(i32.const 1)
)
)
@@ -357,7 +359,7 @@
(drop
(block $label$13 (result anyref)
(br_if $label$13
- (ref.null any)
+ (ref.null eq)
(i32.const 1)
)
)
@@ -379,18 +381,18 @@
)
)
(drop
- (loop $label$16 (result anyref)
- (local.get $local_externref)
+ (loop $label$16 (result eqref)
+ (local.get $local_eqref)
)
)
(drop
- (loop $label$17 (result anyref)
- (global.get $global_externref)
+ (loop $label$17 (result eqref)
+ (global.get $global_eqref)
)
)
(drop
- (loop $label$18 (result anyref)
- (ref.null any)
+ (loop $label$18 (result eqref)
+ (ref.null eq)
)
)
(drop
@@ -430,17 +432,17 @@
)
(drop
(loop $label$26 (result anyref)
- (local.get $local_externref)
+ (local.get $local_eqref)
)
)
(drop
(loop $label$27 (result anyref)
- (global.get $global_externref)
+ (global.get $global_eqref)
)
)
(drop
(loop $label$28 (result anyref)
- (ref.null any)
+ (ref.null eq)
)
)
(drop
@@ -464,10 +466,10 @@
)
)
(drop
- (if (result anyref)
+ (if (result eqref)
(i32.const 1)
- (local.get $local_externref)
- (ref.null any)
+ (local.get $local_eqref)
+ (ref.null eq)
)
)
(drop
@@ -487,14 +489,14 @@
(drop
(if (result anyref)
(i32.const 1)
- (local.get $local_externref)
+ (local.get $local_eqref)
(local.get $local_funcref)
)
)
(drop
(if (result anyref)
(i32.const 1)
- (ref.null any)
+ (ref.null eq)
(ref.null func)
)
)
@@ -502,19 +504,19 @@
(if (result anyref)
(i32.const 1)
(ref.func $foo)
- (ref.null any)
+ (ref.null eq)
)
)
(drop
- (try $label$47 (result anyref)
+ (try $label$47 (result eqref)
(do
- (local.get $local_externref)
+ (local.get $local_eqref)
)
(catch $tag$0
(drop
(pop i32)
)
- (ref.null any)
+ (ref.null eq)
)
)
)
@@ -534,7 +536,7 @@
(drop
(try $label$53 (result anyref)
(do
- (local.get $local_externref)
+ (local.get $local_eqref)
)
(catch $tag$0
(drop
@@ -553,14 +555,14 @@
(drop
(pop i32)
)
- (local.get $local_externref)
+ (local.get $local_eqref)
)
)
)
(drop
- (select (result anyref)
- (local.get $local_externref)
- (ref.null any)
+ (select (result eqref)
+ (local.get $local_eqref)
+ (ref.null eq)
(i32.const 1)
)
)
@@ -580,7 +582,7 @@
)
(drop
(select (result anyref)
- (local.get $local_externref)
+ (local.get $local_eqref)
(local.get $local_funcref)
(i32.const 1)
)
@@ -588,23 +590,23 @@
(drop
(select (result anyref)
(local.get $local_funcref)
- (local.get $local_externref)
+ (local.get $local_eqref)
(i32.const 1)
)
)
(drop
(ref.is_null
- (local.get $local_externref)
+ (local.get $local_eqref)
)
)
(drop
(ref.is_null
- (global.get $global_externref)
+ (global.get $global_eqref)
)
)
(drop
(ref.is_null
- (ref.null any)
+ (ref.null eq)
)
)
(drop
@@ -643,15 +645,15 @@
)
)
)
- (func $return_externref_local (result anyref)
- (local $local_externref anyref)
- (local.get $local_externref)
+ (func $return_eqref_local (result eqref)
+ (local $local_eqref eqref)
+ (local.get $local_eqref)
)
- (func $return_externref_global (result anyref)
- (global.get $global_externref)
+ (func $return_eqref_global (result eqref)
+ (global.get $global_eqref)
)
- (func $return_externref_null (result anyref)
- (ref.null any)
+ (func $return_eqref_null (result eqref)
+ (ref.null eq)
)
(func $return_funcref_local (result funcref)
(local $local_funcref funcref)
@@ -677,14 +679,14 @@
(ref.null any)
)
(func $return_anyref2 (result anyref)
- (local $local_externref anyref)
- (local.get $local_externref)
+ (local $local_eqref eqref)
+ (local.get $local_eqref)
)
(func $return_anyref3 (result anyref)
- (global.get $global_externref)
+ (global.get $global_eqref)
)
(func $return_anyref4 (result anyref)
- (ref.null any)
+ (ref.null eq)
)
(func $return_anyref5 (result anyref)
(local $local_funcref funcref)
@@ -699,10 +701,10 @@
(func $return_anyref8 (result anyref)
(ref.func $foo)
)
- (func $returns_externref (result anyref)
- (local $local_externref anyref)
+ (func $returns_eqref (result eqref)
+ (local $local_eqref eqref)
(return
- (local.get $local_externref)
+ (local.get $local_eqref)
)
)
(func $returns_funcref (result funcref)
@@ -718,10 +720,10 @@
)
)
(func $returns_anyref2 (result anyref)
- (local $local_externref anyref)
+ (local $local_eqref eqref)
(local $local_funcref funcref)
(return
- (local.get $local_externref)
+ (local.get $local_eqref)
)
)
(func $ref-user
diff --git a/test/reference-types.wast.fromBinary.noDebugInfo b/test/reference-types.wast.fromBinary.noDebugInfo
index 42ad4026a..5caa085c9 100644
--- a/test/reference-types.wast.fromBinary.noDebugInfo
+++ b/test/reference-types.wast.fromBinary.noDebugInfo
@@ -3,16 +3,18 @@
(type $anyref_=>_none (func (param anyref)))
(type $funcref_=>_none (func (param funcref)))
(type $none_=>_funcref (func (result funcref)))
+ (type $eqref_=>_none (func (param eqref)))
(type $none_=>_none (func))
+ (type $none_=>_eqref (func (result eqref)))
(type $i32_=>_none (func (param i32)))
- (type $anyref_=>_funcref (func (param anyref) (result funcref)))
- (import "env" "import_global" (global $gimport$0 anyref))
- (import "env" "import_func" (func $fimport$0 (param anyref) (result funcref)))
- (global $global$0 (mut anyref) (ref.null any))
+ (type $eqref_=>_funcref (func (param eqref) (result funcref)))
+ (import "env" "import_global" (global $gimport$0 eqref))
+ (import "env" "import_func" (func $fimport$0 (param eqref) (result funcref)))
+ (global $global$0 (mut eqref) (ref.null eq))
(global $global$1 (mut funcref) (ref.null func))
(global $global$2 (mut funcref) (ref.func $3))
(global $global$3 (mut anyref) (ref.null any))
- (global $global$4 (mut anyref) (ref.null any))
+ (global $global$4 (mut anyref) (ref.null eq))
(global $global$5 (mut anyref) (ref.null func))
(global $global$6 (mut anyref) (ref.func $3))
(table $0 3 3 funcref)
@@ -21,7 +23,7 @@
(tag $tag$0 (param i32))
(export "export_func" (func $fimport$0))
(export "export_global" (global $gimport$0))
- (func $0 (param $0 anyref)
+ (func $0 (param $0 eqref)
(nop)
)
(func $1 (param $0 funcref)
@@ -34,9 +36,9 @@
(nop)
)
(func $4
- (local $0 anyref)
- (local $1 anyref)
- (local $2 funcref)
+ (local $0 eqref)
+ (local $1 funcref)
+ (local $2 anyref)
(local.set $0
(local.get $0)
)
@@ -44,48 +46,48 @@
(global.get $global$0)
)
(local.set $0
- (ref.null any)
+ (ref.null eq)
)
- (local.set $2
- (local.get $2)
+ (local.set $1
+ (local.get $1)
)
- (local.set $2
+ (local.set $1
(global.get $global$1)
)
- (local.set $2
+ (local.set $1
(ref.null func)
)
- (local.set $2
+ (local.set $1
(ref.func $3)
)
- (local.set $1
- (local.get $1)
+ (local.set $2
+ (local.get $2)
)
- (local.set $1
+ (local.set $2
(global.get $global$3)
)
- (local.set $1
+ (local.set $2
(ref.null any)
)
- (local.set $1
+ (local.set $2
(local.get $0)
)
- (local.set $1
+ (local.set $2
(global.get $global$0)
)
- (local.set $1
- (ref.null any)
+ (local.set $2
+ (ref.null eq)
)
- (local.set $1
- (local.get $2)
+ (local.set $2
+ (local.get $1)
)
- (local.set $1
+ (local.set $2
(global.get $global$1)
)
- (local.set $1
+ (local.set $2
(ref.null func)
)
- (local.set $1
+ (local.set $2
(ref.func $3)
)
(global.set $global$0
@@ -95,13 +97,13 @@
(local.get $0)
)
(global.set $global$0
- (ref.null any)
+ (ref.null eq)
)
(global.set $global$1
(global.get $global$1)
)
(global.set $global$1
- (local.get $2)
+ (local.get $1)
)
(global.set $global$1
(ref.null func)
@@ -113,7 +115,7 @@
(global.get $global$3)
)
(global.set $global$3
- (local.get $1)
+ (local.get $2)
)
(global.set $global$3
(ref.null any)
@@ -125,13 +127,13 @@
(local.get $0)
)
(global.set $global$3
- (ref.null any)
+ (ref.null eq)
)
(global.set $global$3
(global.get $global$1)
)
(global.set $global$3
- (local.get $2)
+ (local.get $1)
)
(global.set $global$3
(ref.null func)
@@ -146,10 +148,10 @@
(global.get $global$0)
)
(call $0
- (ref.null any)
+ (ref.null eq)
)
(call $1
- (local.get $2)
+ (local.get $1)
)
(call $1
(global.get $global$1)
@@ -161,7 +163,7 @@
(ref.func $3)
)
(call $2
- (local.get $1)
+ (local.get $2)
)
(call $2
(global.get $global$3)
@@ -176,10 +178,10 @@
(global.get $global$0)
)
(call $2
- (ref.null any)
+ (ref.null eq)
)
(call $2
- (local.get $2)
+ (local.get $1)
)
(call $2
(global.get $global$1)
@@ -190,20 +192,20 @@
(call $2
(ref.func $3)
)
- (call_indirect $0 (type $anyref_=>_none)
+ (call_indirect $0 (type $eqref_=>_none)
(local.get $0)
(i32.const 0)
)
- (call_indirect $0 (type $anyref_=>_none)
+ (call_indirect $0 (type $eqref_=>_none)
(global.get $global$0)
(i32.const 0)
)
- (call_indirect $0 (type $anyref_=>_none)
- (ref.null any)
+ (call_indirect $0 (type $eqref_=>_none)
+ (ref.null eq)
(i32.const 0)
)
(call_indirect $0 (type $funcref_=>_none)
- (local.get $2)
+ (local.get $1)
(i32.const 1)
)
(call_indirect $0 (type $funcref_=>_none)
@@ -219,7 +221,7 @@
(i32.const 1)
)
(call_indirect $0 (type $anyref_=>_none)
- (local.get $1)
+ (local.get $2)
(i32.const 3)
)
(call_indirect $0 (type $anyref_=>_none)
@@ -239,11 +241,11 @@
(i32.const 3)
)
(call_indirect $0 (type $anyref_=>_none)
- (ref.null any)
+ (ref.null eq)
(i32.const 3)
)
(call_indirect $0 (type $anyref_=>_none)
- (local.get $2)
+ (local.get $1)
(i32.const 3)
)
(call_indirect $0 (type $anyref_=>_none)
@@ -259,7 +261,7 @@
(i32.const 3)
)
(drop
- (block $label$1 (result anyref)
+ (block $label$1 (result eqref)
(br_if $label$1
(local.get $0)
(i32.const 1)
@@ -267,7 +269,7 @@
)
)
(drop
- (block $label$2 (result anyref)
+ (block $label$2 (result eqref)
(br_if $label$2
(global.get $global$0)
(i32.const 1)
@@ -275,9 +277,9 @@
)
)
(drop
- (block $label$3 (result anyref)
+ (block $label$3 (result eqref)
(br_if $label$3
- (ref.null any)
+ (ref.null eq)
(i32.const 1)
)
)
@@ -285,7 +287,7 @@
(drop
(block $label$4 (result funcref)
(br_if $label$4
- (local.get $2)
+ (local.get $1)
(i32.const 1)
)
)
@@ -317,7 +319,7 @@
(drop
(block $label$8 (result anyref)
(br_if $label$8
- (local.get $1)
+ (local.get $2)
(i32.const 1)
)
)
@@ -349,7 +351,7 @@
(drop
(block $label$12 (result anyref)
(br_if $label$12
- (local.get $2)
+ (local.get $1)
(i32.const 1)
)
)
@@ -357,7 +359,7 @@
(drop
(block $label$13 (result anyref)
(br_if $label$13
- (ref.null any)
+ (ref.null eq)
(i32.const 1)
)
)
@@ -379,23 +381,23 @@
)
)
(drop
- (loop $label$16 (result anyref)
+ (loop $label$16 (result eqref)
(local.get $0)
)
)
(drop
- (loop $label$17 (result anyref)
+ (loop $label$17 (result eqref)
(global.get $global$0)
)
)
(drop
- (loop $label$18 (result anyref)
- (ref.null any)
+ (loop $label$18 (result eqref)
+ (ref.null eq)
)
)
(drop
(loop $label$19 (result funcref)
- (local.get $2)
+ (local.get $1)
)
)
(drop
@@ -415,7 +417,7 @@
)
(drop
(loop $label$23 (result anyref)
- (local.get $1)
+ (local.get $2)
)
)
(drop
@@ -440,12 +442,12 @@
)
(drop
(loop $label$28 (result anyref)
- (ref.null any)
+ (ref.null eq)
)
)
(drop
(loop $label$29 (result anyref)
- (local.get $2)
+ (local.get $1)
)
)
(drop
@@ -464,23 +466,23 @@
)
)
(drop
- (if (result anyref)
+ (if (result eqref)
(i32.const 1)
(local.get $0)
- (ref.null any)
+ (ref.null eq)
)
)
(drop
(if (result funcref)
(i32.const 1)
- (local.get $2)
+ (local.get $1)
(ref.null func)
)
)
(drop
(if (result anyref)
(i32.const 1)
- (local.get $1)
+ (local.get $2)
(ref.null any)
)
)
@@ -488,13 +490,13 @@
(if (result anyref)
(i32.const 1)
(local.get $0)
- (local.get $2)
+ (local.get $1)
)
)
(drop
(if (result anyref)
(i32.const 1)
- (ref.null any)
+ (ref.null eq)
(ref.null func)
)
)
@@ -502,11 +504,11 @@
(if (result anyref)
(i32.const 1)
(ref.func $3)
- (ref.null any)
+ (ref.null eq)
)
)
(drop
- (try $label$47 (result anyref)
+ (try $label$47 (result eqref)
(do
(local.get $0)
)
@@ -514,7 +516,7 @@
(drop
(pop i32)
)
- (ref.null any)
+ (ref.null eq)
)
)
)
@@ -558,15 +560,15 @@
)
)
(drop
- (select (result anyref)
+ (select (result eqref)
(local.get $0)
- (ref.null any)
+ (ref.null eq)
(i32.const 1)
)
)
(drop
(select (result funcref)
- (local.get $2)
+ (local.get $1)
(ref.null func)
(i32.const 1)
)
@@ -581,13 +583,13 @@
(drop
(select (result anyref)
(local.get $0)
- (local.get $2)
+ (local.get $1)
(i32.const 1)
)
)
(drop
(select (result anyref)
- (local.get $2)
+ (local.get $1)
(local.get $0)
(i32.const 1)
)
@@ -604,12 +606,12 @@
)
(drop
(ref.is_null
- (ref.null any)
+ (ref.null eq)
)
)
(drop
(ref.is_null
- (local.get $2)
+ (local.get $1)
)
)
(drop
@@ -629,7 +631,7 @@
)
(drop
(ref.is_null
- (local.get $1)
+ (local.get $2)
)
)
(drop
@@ -643,15 +645,15 @@
)
)
)
- (func $5 (result anyref)
- (local $0 anyref)
+ (func $5 (result eqref)
+ (local $0 eqref)
(local.get $0)
)
- (func $6 (result anyref)
+ (func $6 (result eqref)
(global.get $global$0)
)
- (func $7 (result anyref)
- (ref.null any)
+ (func $7 (result eqref)
+ (ref.null eq)
)
(func $8 (result funcref)
(local $0 funcref)
@@ -677,14 +679,14 @@
(ref.null any)
)
(func $15 (result anyref)
- (local $0 anyref)
+ (local $0 eqref)
(local.get $0)
)
(func $16 (result anyref)
(global.get $global$0)
)
(func $17 (result anyref)
- (ref.null any)
+ (ref.null eq)
)
(func $18 (result anyref)
(local $0 funcref)
@@ -699,8 +701,8 @@
(func $21 (result anyref)
(ref.func $3)
)
- (func $22 (result anyref)
- (local $0 anyref)
+ (func $22 (result eqref)
+ (local $0 eqref)
(return
(local.get $0)
)
@@ -718,7 +720,7 @@
)
)
(func $25 (result anyref)
- (local $0 anyref)
+ (local $0 eqref)
(local $1 funcref)
(return
(local.get $0)
diff --git a/test/unit/test_features.py b/test/unit/test_features.py
index 5c22886fb..03862d4cc 100644
--- a/test/unit/test_features.py
+++ b/test/unit/test_features.py
@@ -343,7 +343,7 @@ class TargetFeaturesSectionTest(utils.BinaryenTestCase):
self.roundtrip(filename)
self.check_features(filename, ['reference-types', 'gc'])
disassembly = self.disassemble(filename)
- self.assertIn('anyref', disassembly)
+ self.assertIn('externref', disassembly)
self.assertIn('eqref', disassembly)
def test_superset(self):