summaryrefslogtreecommitdiff
path: root/test/spec/ref_test.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/spec/ref_test.wast')
-rw-r--r--test/spec/ref_test.wast228
1 files changed, 114 insertions, 114 deletions
diff --git a/test/spec/ref_test.wast b/test/spec/ref_test.wast
index b5291e179..6b6369459 100644
--- a/test/spec/ref_test.wast
+++ b/test/spec/ref_test.wast
@@ -37,63 +37,63 @@
(func (export "ref_test_null_data") (param $i i32) (result i32)
(i32.add
(ref.is_null (table.get $ta (local.get $i)))
- (ref.test null none (table.get $ta (local.get $i)))
+ (ref.test nullref (table.get $ta (local.get $i)))
)
)
(func (export "ref_test_any") (param $i i32) (result i32)
(i32.add
- (ref.test any (table.get $ta (local.get $i)))
- (ref.test null any (table.get $ta (local.get $i)))
+ (ref.test (ref any) (table.get $ta (local.get $i)))
+ (ref.test anyref (table.get $ta (local.get $i)))
)
)
(func (export "ref_test_eq") (param $i i32) (result i32)
(i32.add
- (ref.test eq (table.get $ta (local.get $i)))
- (ref.test null eq (table.get $ta (local.get $i)))
+ (ref.test (ref eq) (table.get $ta (local.get $i)))
+ (ref.test eqref (table.get $ta (local.get $i)))
)
)
(func (export "ref_test_i31") (param $i i32) (result i32)
(i32.add
- (ref.test i31 (table.get $ta (local.get $i)))
- (ref.test null i31 (table.get $ta (local.get $i)))
+ (ref.test (ref i31) (table.get $ta (local.get $i)))
+ (ref.test i31ref (table.get $ta (local.get $i)))
)
)
(func (export "ref_test_struct") (param $i i32) (result i32)
(i32.add
- (ref.test struct (table.get $ta (local.get $i)))
- (ref.test null struct (table.get $ta (local.get $i)))
+ (ref.test (ref struct) (table.get $ta (local.get $i)))
+ (ref.test structref (table.get $ta (local.get $i)))
)
)
(func (export "ref_test_array") (param $i i32) (result i32)
(i32.add
- (ref.test array (table.get $ta (local.get $i)))
- (ref.test null array (table.get $ta (local.get $i)))
+ (ref.test (ref array) (table.get $ta (local.get $i)))
+ (ref.test arrayref (table.get $ta (local.get $i)))
)
)
(func (export "ref_test_null_func") (param $i i32) (result i32)
(i32.add
(ref.is_null (table.get $tf (local.get $i)))
- (ref.test null nofunc (table.get $tf (local.get $i)))
+ (ref.test nullfuncref (table.get $tf (local.get $i)))
)
)
(func (export "ref_test_func") (param $i i32) (result i32)
(i32.add
- (ref.test func (table.get $tf (local.get $i)))
- (ref.test null func (table.get $tf (local.get $i)))
+ (ref.test (ref func) (table.get $tf (local.get $i)))
+ (ref.test funcref (table.get $tf (local.get $i)))
)
)
(func (export "ref_test_null_extern") (param $i i32) (result i32)
(i32.add
(ref.is_null (table.get $te (local.get $i)))
- (ref.test null noextern (table.get $te (local.get $i)))
+ (ref.test nullexternref (table.get $te (local.get $i)))
)
)
(func (export "ref_test_extern") (param $i i32) (result i32)
(i32.add
- (ref.test extern (table.get $te (local.get $i)))
- (ref.test null extern (table.get $te (local.get $i)))
+ (ref.test (ref extern) (table.get $te (local.get $i)))
+ (ref.test externref (table.get $te (local.get $i)))
)
)
)
@@ -206,91 +206,91 @@
(call $init)
(block $l
;; must hold
- (br_if $l (i32.eqz (ref.test null $t0 (ref.null struct))))
- (br_if $l (i32.eqz (ref.test null $t0 (ref.null $t0))))
- (br_if $l (i32.eqz (ref.test null $t0 (ref.null $t1))))
- (br_if $l (i32.eqz (ref.test null $t0 (ref.null $t2))))
- (br_if $l (i32.eqz (ref.test null $t0 (ref.null $t3))))
- (br_if $l (i32.eqz (ref.test null $t0 (ref.null $t4))))
- (br_if $l (i32.eqz (ref.test null $t0 (table.get $tab (i32.const 0)))))
- (br_if $l (i32.eqz (ref.test null $t0 (table.get $tab (i32.const 1)))))
- (br_if $l (i32.eqz (ref.test null $t0 (table.get $tab (i32.const 2)))))
- (br_if $l (i32.eqz (ref.test null $t0 (table.get $tab (i32.const 3)))))
- (br_if $l (i32.eqz (ref.test null $t0 (table.get $tab (i32.const 4)))))
-
- (br_if $l (i32.eqz (ref.test null $t1 (ref.null struct))))
- (br_if $l (i32.eqz (ref.test null $t1 (ref.null $t0))))
- (br_if $l (i32.eqz (ref.test null $t1 (ref.null $t1))))
- (br_if $l (i32.eqz (ref.test null $t1 (ref.null $t2))))
- (br_if $l (i32.eqz (ref.test null $t1 (ref.null $t3))))
- (br_if $l (i32.eqz (ref.test null $t1 (ref.null $t4))))
- (br_if $l (i32.eqz (ref.test null $t1 (table.get $tab (i32.const 1)))))
- (br_if $l (i32.eqz (ref.test null $t1 (table.get $tab (i32.const 2)))))
-
- (br_if $l (i32.eqz (ref.test null $t2 (ref.null struct))))
- (br_if $l (i32.eqz (ref.test null $t2 (ref.null $t0))))
- (br_if $l (i32.eqz (ref.test null $t2 (ref.null $t1))))
- (br_if $l (i32.eqz (ref.test null $t2 (ref.null $t2))))
- (br_if $l (i32.eqz (ref.test null $t2 (ref.null $t3))))
- (br_if $l (i32.eqz (ref.test null $t2 (ref.null $t4))))
- (br_if $l (i32.eqz (ref.test null $t2 (table.get $tab (i32.const 2)))))
-
- (br_if $l (i32.eqz (ref.test null $t3 (ref.null struct))))
- (br_if $l (i32.eqz (ref.test null $t3 (ref.null $t0))))
- (br_if $l (i32.eqz (ref.test null $t3 (ref.null $t1))))
- (br_if $l (i32.eqz (ref.test null $t3 (ref.null $t2))))
- (br_if $l (i32.eqz (ref.test null $t3 (ref.null $t3))))
- (br_if $l (i32.eqz (ref.test null $t3 (ref.null $t4))))
- (br_if $l (i32.eqz (ref.test null $t3 (table.get $tab (i32.const 3)))))
-
- (br_if $l (i32.eqz (ref.test null $t4 (ref.null struct))))
- (br_if $l (i32.eqz (ref.test null $t4 (ref.null $t0))))
- (br_if $l (i32.eqz (ref.test null $t4 (ref.null $t1))))
- (br_if $l (i32.eqz (ref.test null $t4 (ref.null $t2))))
- (br_if $l (i32.eqz (ref.test null $t4 (ref.null $t3))))
- (br_if $l (i32.eqz (ref.test null $t4 (ref.null $t4))))
- (br_if $l (i32.eqz (ref.test null $t4 (table.get $tab (i32.const 4)))))
-
- (br_if $l (i32.eqz (ref.test $t0 (table.get $tab (i32.const 0)))))
- (br_if $l (i32.eqz (ref.test $t0 (table.get $tab (i32.const 1)))))
- (br_if $l (i32.eqz (ref.test $t0 (table.get $tab (i32.const 2)))))
- (br_if $l (i32.eqz (ref.test $t0 (table.get $tab (i32.const 3)))))
- (br_if $l (i32.eqz (ref.test $t0 (table.get $tab (i32.const 4)))))
-
- (br_if $l (i32.eqz (ref.test $t1 (table.get $tab (i32.const 1)))))
- (br_if $l (i32.eqz (ref.test $t1 (table.get $tab (i32.const 2)))))
-
- (br_if $l (i32.eqz (ref.test $t2 (table.get $tab (i32.const 2)))))
-
- (br_if $l (i32.eqz (ref.test $t3 (table.get $tab (i32.const 3)))))
-
- (br_if $l (i32.eqz (ref.test $t4 (table.get $tab (i32.const 4)))))
+ (br_if $l (i32.eqz (ref.test (ref null $t0) (ref.null struct))))
+ (br_if $l (i32.eqz (ref.test (ref null $t0) (ref.null $t0))))
+ (br_if $l (i32.eqz (ref.test (ref null $t0) (ref.null $t1))))
+ (br_if $l (i32.eqz (ref.test (ref null $t0) (ref.null $t2))))
+ (br_if $l (i32.eqz (ref.test (ref null $t0) (ref.null $t3))))
+ (br_if $l (i32.eqz (ref.test (ref null $t0) (ref.null $t4))))
+ (br_if $l (i32.eqz (ref.test (ref null $t0) (table.get $tab (i32.const 0)))))
+ (br_if $l (i32.eqz (ref.test (ref null $t0) (table.get $tab (i32.const 1)))))
+ (br_if $l (i32.eqz (ref.test (ref null $t0) (table.get $tab (i32.const 2)))))
+ (br_if $l (i32.eqz (ref.test (ref null $t0) (table.get $tab (i32.const 3)))))
+ (br_if $l (i32.eqz (ref.test (ref null $t0) (table.get $tab (i32.const 4)))))
+
+ (br_if $l (i32.eqz (ref.test (ref null $t1) (ref.null struct))))
+ (br_if $l (i32.eqz (ref.test (ref null $t1) (ref.null $t0))))
+ (br_if $l (i32.eqz (ref.test (ref null $t1) (ref.null $t1))))
+ (br_if $l (i32.eqz (ref.test (ref null $t1) (ref.null $t2))))
+ (br_if $l (i32.eqz (ref.test (ref null $t1) (ref.null $t3))))
+ (br_if $l (i32.eqz (ref.test (ref null $t1) (ref.null $t4))))
+ (br_if $l (i32.eqz (ref.test (ref null $t1) (table.get $tab (i32.const 1)))))
+ (br_if $l (i32.eqz (ref.test (ref null $t1) (table.get $tab (i32.const 2)))))
+
+ (br_if $l (i32.eqz (ref.test (ref null $t2) (ref.null struct))))
+ (br_if $l (i32.eqz (ref.test (ref null $t2) (ref.null $t0))))
+ (br_if $l (i32.eqz (ref.test (ref null $t2) (ref.null $t1))))
+ (br_if $l (i32.eqz (ref.test (ref null $t2) (ref.null $t2))))
+ (br_if $l (i32.eqz (ref.test (ref null $t2) (ref.null $t3))))
+ (br_if $l (i32.eqz (ref.test (ref null $t2) (ref.null $t4))))
+ (br_if $l (i32.eqz (ref.test (ref null $t2) (table.get $tab (i32.const 2)))))
+
+ (br_if $l (i32.eqz (ref.test (ref null $t3) (ref.null struct))))
+ (br_if $l (i32.eqz (ref.test (ref null $t3) (ref.null $t0))))
+ (br_if $l (i32.eqz (ref.test (ref null $t3) (ref.null $t1))))
+ (br_if $l (i32.eqz (ref.test (ref null $t3) (ref.null $t2))))
+ (br_if $l (i32.eqz (ref.test (ref null $t3) (ref.null $t3))))
+ (br_if $l (i32.eqz (ref.test (ref null $t3) (ref.null $t4))))
+ (br_if $l (i32.eqz (ref.test (ref null $t3) (table.get $tab (i32.const 3)))))
+
+ (br_if $l (i32.eqz (ref.test (ref null $t4) (ref.null struct))))
+ (br_if $l (i32.eqz (ref.test (ref null $t4) (ref.null $t0))))
+ (br_if $l (i32.eqz (ref.test (ref null $t4) (ref.null $t1))))
+ (br_if $l (i32.eqz (ref.test (ref null $t4) (ref.null $t2))))
+ (br_if $l (i32.eqz (ref.test (ref null $t4) (ref.null $t3))))
+ (br_if $l (i32.eqz (ref.test (ref null $t4) (ref.null $t4))))
+ (br_if $l (i32.eqz (ref.test (ref null $t4) (table.get $tab (i32.const 4)))))
+
+ (br_if $l (i32.eqz (ref.test (ref $t0) (table.get $tab (i32.const 0)))))
+ (br_if $l (i32.eqz (ref.test (ref $t0) (table.get $tab (i32.const 1)))))
+ (br_if $l (i32.eqz (ref.test (ref $t0) (table.get $tab (i32.const 2)))))
+ (br_if $l (i32.eqz (ref.test (ref $t0) (table.get $tab (i32.const 3)))))
+ (br_if $l (i32.eqz (ref.test (ref $t0) (table.get $tab (i32.const 4)))))
+
+ (br_if $l (i32.eqz (ref.test (ref $t1) (table.get $tab (i32.const 1)))))
+ (br_if $l (i32.eqz (ref.test (ref $t1) (table.get $tab (i32.const 2)))))
+
+ (br_if $l (i32.eqz (ref.test (ref $t2) (table.get $tab (i32.const 2)))))
+
+ (br_if $l (i32.eqz (ref.test (ref $t3) (table.get $tab (i32.const 3)))))
+
+ (br_if $l (i32.eqz (ref.test (ref $t4) (table.get $tab (i32.const 4)))))
;; must not hold
- (br_if $l (ref.test $t0 (ref.null struct)))
- (br_if $l (ref.test $t1 (ref.null struct)))
- (br_if $l (ref.test $t2 (ref.null struct)))
- (br_if $l (ref.test $t3 (ref.null struct)))
- (br_if $l (ref.test $t4 (ref.null struct)))
-
- (br_if $l (ref.test $t1 (table.get $tab (i32.const 0))))
- (br_if $l (ref.test $t1 (table.get $tab (i32.const 3))))
- (br_if $l (ref.test $t1 (table.get $tab (i32.const 4))))
-
- (br_if $l (ref.test $t2 (table.get $tab (i32.const 0))))
- (br_if $l (ref.test $t2 (table.get $tab (i32.const 1))))
- (br_if $l (ref.test $t2 (table.get $tab (i32.const 3))))
- (br_if $l (ref.test $t2 (table.get $tab (i32.const 4))))
-
- (br_if $l (ref.test $t3 (table.get $tab (i32.const 0))))
- (br_if $l (ref.test $t3 (table.get $tab (i32.const 1))))
- (br_if $l (ref.test $t3 (table.get $tab (i32.const 2))))
- (br_if $l (ref.test $t3 (table.get $tab (i32.const 4))))
-
- (br_if $l (ref.test $t4 (table.get $tab (i32.const 0))))
- (br_if $l (ref.test $t4 (table.get $tab (i32.const 1))))
- (br_if $l (ref.test $t4 (table.get $tab (i32.const 2))))
- (br_if $l (ref.test $t4 (table.get $tab (i32.const 3))))
+ (br_if $l (ref.test (ref $t0) (ref.null struct)))
+ (br_if $l (ref.test (ref $t1) (ref.null struct)))
+ (br_if $l (ref.test (ref $t2) (ref.null struct)))
+ (br_if $l (ref.test (ref $t3) (ref.null struct)))
+ (br_if $l (ref.test (ref $t4) (ref.null struct)))
+
+ (br_if $l (ref.test (ref $t1) (table.get $tab (i32.const 0))))
+ (br_if $l (ref.test (ref $t1) (table.get $tab (i32.const 3))))
+ (br_if $l (ref.test (ref $t1) (table.get $tab (i32.const 4))))
+
+ (br_if $l (ref.test (ref $t2) (table.get $tab (i32.const 0))))
+ (br_if $l (ref.test (ref $t2) (table.get $tab (i32.const 1))))
+ (br_if $l (ref.test (ref $t2) (table.get $tab (i32.const 3))))
+ (br_if $l (ref.test (ref $t2) (table.get $tab (i32.const 4))))
+
+ (br_if $l (ref.test (ref $t3) (table.get $tab (i32.const 0))))
+ (br_if $l (ref.test (ref $t3) (table.get $tab (i32.const 1))))
+ (br_if $l (ref.test (ref $t3) (table.get $tab (i32.const 2))))
+ (br_if $l (ref.test (ref $t3) (table.get $tab (i32.const 4))))
+
+ (br_if $l (ref.test (ref $t4) (table.get $tab (i32.const 0))))
+ (br_if $l (ref.test (ref $t4) (table.get $tab (i32.const 1))))
+ (br_if $l (ref.test (ref $t4) (table.get $tab (i32.const 2))))
+ (br_if $l (ref.test (ref $t4) (table.get $tab (i32.const 3))))
(return)
)
@@ -300,25 +300,25 @@
(func (export "test-canon")
(call $init)
(block $l
- (br_if $l (i32.eqz (ref.test $t0 (table.get $tab (i32.const 0)))))
- (br_if $l (i32.eqz (ref.test $t0 (table.get $tab (i32.const 1)))))
- (br_if $l (i32.eqz (ref.test $t0 (table.get $tab (i32.const 2)))))
- (br_if $l (i32.eqz (ref.test $t0 (table.get $tab (i32.const 3)))))
- (br_if $l (i32.eqz (ref.test $t0 (table.get $tab (i32.const 4)))))
+ (br_if $l (i32.eqz (ref.test (ref $t0) (table.get $tab (i32.const 0)))))
+ (br_if $l (i32.eqz (ref.test (ref $t0) (table.get $tab (i32.const 1)))))
+ (br_if $l (i32.eqz (ref.test (ref $t0) (table.get $tab (i32.const 2)))))
+ (br_if $l (i32.eqz (ref.test (ref $t0) (table.get $tab (i32.const 3)))))
+ (br_if $l (i32.eqz (ref.test (ref $t0) (table.get $tab (i32.const 4)))))
- (br_if $l (i32.eqz (ref.test $t0 (table.get $tab (i32.const 10)))))
- (br_if $l (i32.eqz (ref.test $t0 (table.get $tab (i32.const 11)))))
- (br_if $l (i32.eqz (ref.test $t0 (table.get $tab (i32.const 12)))))
+ (br_if $l (i32.eqz (ref.test (ref $t0) (table.get $tab (i32.const 10)))))
+ (br_if $l (i32.eqz (ref.test (ref $t0) (table.get $tab (i32.const 11)))))
+ (br_if $l (i32.eqz (ref.test (ref $t0) (table.get $tab (i32.const 12)))))
- (br_if $l (i32.eqz (ref.test $t1' (table.get $tab (i32.const 1)))))
- (br_if $l (i32.eqz (ref.test $t1' (table.get $tab (i32.const 2)))))
+ (br_if $l (i32.eqz (ref.test (ref $t1') (table.get $tab (i32.const 1)))))
+ (br_if $l (i32.eqz (ref.test (ref $t1') (table.get $tab (i32.const 2)))))
- (br_if $l (i32.eqz (ref.test $t1 (table.get $tab (i32.const 11)))))
- (br_if $l (i32.eqz (ref.test $t1 (table.get $tab (i32.const 12)))))
+ (br_if $l (i32.eqz (ref.test (ref $t1) (table.get $tab (i32.const 11)))))
+ (br_if $l (i32.eqz (ref.test (ref $t1) (table.get $tab (i32.const 12)))))
- (br_if $l (i32.eqz (ref.test $t2' (table.get $tab (i32.const 2)))))
+ (br_if $l (i32.eqz (ref.test (ref $t2') (table.get $tab (i32.const 2)))))
- (br_if $l (i32.eqz (ref.test $t2 (table.get $tab (i32.const 12)))))
+ (br_if $l (i32.eqz (ref.test (ref $t2) (table.get $tab (i32.const 12)))))
(return)
)