Update unit test cases (#4214)
* Update gc unit test cases * Update aot stack frame unit test cases
This commit is contained in:
Binary file not shown.
@ -26,10 +26,10 @@
|
||||
(local (ref null struct))
|
||||
|
||||
local.get 0
|
||||
ref.test null array
|
||||
ref.test (ref array)
|
||||
drop
|
||||
local.get 1
|
||||
ref.cast i31
|
||||
ref.cast (ref i31)
|
||||
drop
|
||||
)
|
||||
)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,18 +1,36 @@
|
||||
(module
|
||||
(type $vec (struct (field f32) (field $y (mut f32)) (field $z f32)))
|
||||
|
||||
;;(global (ref $vec) (struct.new_canon $vec (f32.const 1) (f32.const 2) (f32.const 3)))
|
||||
(global (ref $vec) (struct.new_canon_default $vec))
|
||||
(global (ref $vec) (struct.new $vec (f32.const 1) (f32.const 2) (f32.const 3)))
|
||||
(global (ref $vec) (struct.new_default $vec))
|
||||
|
||||
(func (export "new") (result anyref)
|
||||
(struct.new_canon_default $vec)
|
||||
(struct.new_default $vec)
|
||||
)
|
||||
|
||||
(func $get_0 (param $v (ref $vec)) (result f32)
|
||||
(func $get_0_0 (param $v (ref $vec)) (result f32)
|
||||
(struct.get 0 0 (local.get $v))
|
||||
)
|
||||
(func (export "get_0_0") (result f32)
|
||||
(call $get_0_0 (struct.new_default $vec))
|
||||
)
|
||||
(func $get_vec_0 (param $v (ref $vec)) (result f32)
|
||||
(struct.get $vec 0 (local.get $v))
|
||||
)
|
||||
(func (export "get_0") (result f32)
|
||||
(call $get_0 (struct.new_canon_default $vec))
|
||||
(func (export "get_vec_0") (result f32)
|
||||
(call $get_vec_0 (struct.new_default $vec))
|
||||
)
|
||||
(func $get_0_y (param $v (ref $vec)) (result f32)
|
||||
(struct.get 0 $y (local.get $v))
|
||||
)
|
||||
(func (export "get_0_y") (result f32)
|
||||
(call $get_0_y (struct.new_default $vec))
|
||||
)
|
||||
(func $get_vec_y (param $v (ref $vec)) (result f32)
|
||||
(struct.get $vec $y (local.get $v))
|
||||
)
|
||||
(func (export "get_vec_y") (result f32)
|
||||
(call $get_vec_y (struct.new_default $vec))
|
||||
)
|
||||
|
||||
(func $set_get_y (param $v (ref $vec)) (param $y f32) (result f32)
|
||||
@ -20,7 +38,7 @@
|
||||
(struct.get $vec $y (local.get $v))
|
||||
)
|
||||
(func (export "set_get_y") (param $y f32) (result f32)
|
||||
(call $set_get_y (struct.new_canon_default $vec) (local.get $y))
|
||||
(call $set_get_y (struct.new_default $vec) (local.get $y))
|
||||
)
|
||||
|
||||
(func $set_get_1 (param $v (ref $vec)) (param $y f32) (result f32)
|
||||
@ -28,6 +46,6 @@
|
||||
(struct.get $vec $y (local.get $v))
|
||||
)
|
||||
(func (export "set_get_1") (param $y f32) (result f32)
|
||||
(call $set_get_1 (struct.new_canon_default $vec) (local.get $y))
|
||||
(call $set_get_1 (struct.new_default $vec) (local.get $y))
|
||||
)
|
||||
)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -14,11 +14,11 @@
|
||||
(table.set $ta (i32.const 0) (ref.null any))
|
||||
(table.set $ta (i32.const 1) (ref.null struct))
|
||||
(table.set $ta (i32.const 2) (ref.null none))
|
||||
(table.set $ta (i32.const 3) (i31.new (i32.const 7)))
|
||||
(table.set $ta (i32.const 4) (struct.new_canon_default $st))
|
||||
(table.set $ta (i32.const 5) (array.new_canon_default $at (i32.const 0)))
|
||||
(table.set $ta (i32.const 6) (extern.internalize (local.get $x)))
|
||||
(table.set $ta (i32.const 7) (extern.internalize (ref.null extern)))
|
||||
(table.set $ta (i32.const 3) (ref.i31 (i32.const 7)))
|
||||
(table.set $ta (i32.const 4) (struct.new_default $st))
|
||||
(table.set $ta (i32.const 5) (array.new_default $at (i32.const 0)))
|
||||
(table.set $ta (i32.const 6) (any.convert_extern (local.get $x)))
|
||||
(table.set $ta (i32.const 7) (any.convert_extern (ref.null extern)))
|
||||
|
||||
(table.set $tf (i32.const 0) (ref.null nofunc))
|
||||
(table.set $tf (i32.const 1) (ref.null func))
|
||||
@ -27,78 +27,71 @@
|
||||
(table.set $te (i32.const 0) (ref.null noextern))
|
||||
(table.set $te (i32.const 1) (ref.null extern))
|
||||
(table.set $te (i32.const 2) (local.get $x))
|
||||
(table.set $te (i32.const 3) (extern.externalize (i31.new (i32.const 8))))
|
||||
(table.set $te (i32.const 4) (extern.externalize (struct.new_canon_default $st)))
|
||||
(table.set $te (i32.const 5) (extern.externalize (ref.null any)))
|
||||
(table.set $te (i32.const 3) (extern.convert_any (ref.i31 (i32.const 8))))
|
||||
(table.set $te (i32.const 4) (extern.convert_any (struct.new_default $st)))
|
||||
(table.set $te (i32.const 5) (extern.convert_any (ref.null any)))
|
||||
)
|
||||
|
||||
(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 (ref null nofunc) (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 (ref null noextern) (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)))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
Binary file not shown.
@ -11,105 +11,105 @@
|
||||
(table 20 (ref null struct))
|
||||
|
||||
(func $init
|
||||
(table.set (i32.const 0) (struct.new_canon_default $t0))
|
||||
(table.set (i32.const 10) (struct.new_canon_default $t0))
|
||||
(table.set (i32.const 1) (struct.new_canon_default $t1))
|
||||
(table.set (i32.const 11) (struct.new_canon_default $t1'))
|
||||
(table.set (i32.const 2) (struct.new_canon_default $t2))
|
||||
(table.set (i32.const 12) (struct.new_canon_default $t2'))
|
||||
(table.set (i32.const 3) (struct.new_canon_default $t3))
|
||||
(table.set (i32.const 4) (struct.new_canon_default $t4))
|
||||
(table.set (i32.const 0) (struct.new_default $t0))
|
||||
(table.set (i32.const 10) (struct.new_default $t0))
|
||||
(table.set (i32.const 1) (struct.new_default $t1))
|
||||
(table.set (i32.const 11) (struct.new_default $t1'))
|
||||
(table.set (i32.const 2) (struct.new_default $t2))
|
||||
(table.set (i32.const 12) (struct.new_default $t2'))
|
||||
(table.set (i32.const 3) (struct.new_default $t3))
|
||||
(table.set (i32.const 4) (struct.new_default $t4))
|
||||
)
|
||||
|
||||
(func (export "test-sub")
|
||||
(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 (i32.const 0)))))
|
||||
(br_if $l (i32.eqz (ref.test null $t0 (table.get (i32.const 1)))))
|
||||
(br_if $l (i32.eqz (ref.test null $t0 (table.get (i32.const 2)))))
|
||||
(br_if $l (i32.eqz (ref.test null $t0 (table.get (i32.const 3)))))
|
||||
(br_if $l (i32.eqz (ref.test null $t0 (table.get (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 (i32.const 0)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref null $t0) (table.get (i32.const 1)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref null $t0) (table.get (i32.const 2)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref null $t0) (table.get (i32.const 3)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref null $t0) (table.get (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 (i32.const 1)))))
|
||||
(br_if $l (i32.eqz (ref.test null $t1 (table.get (i32.const 2)))))
|
||||
(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 (i32.const 1)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref null $t1) (table.get (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 (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 (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 (i32.const 3)))))
|
||||
(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 (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 (i32.const 4)))))
|
||||
(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 (i32.const 4)))))
|
||||
|
||||
(br_if $l (i32.eqz (ref.test $t0 (table.get (i32.const 0)))))
|
||||
(br_if $l (i32.eqz (ref.test $t0 (table.get (i32.const 1)))))
|
||||
(br_if $l (i32.eqz (ref.test $t0 (table.get (i32.const 2)))))
|
||||
(br_if $l (i32.eqz (ref.test $t0 (table.get (i32.const 3)))))
|
||||
(br_if $l (i32.eqz (ref.test $t0 (table.get (i32.const 4)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t0) (table.get (i32.const 0)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t0) (table.get (i32.const 1)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t0) (table.get (i32.const 2)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t0) (table.get (i32.const 3)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t0) (table.get (i32.const 4)))))
|
||||
|
||||
(br_if $l (i32.eqz (ref.test $t1 (table.get (i32.const 1)))))
|
||||
(br_if $l (i32.eqz (ref.test $t1 (table.get (i32.const 2)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t1) (table.get (i32.const 1)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t1) (table.get (i32.const 2)))))
|
||||
|
||||
(br_if $l (i32.eqz (ref.test $t2 (table.get (i32.const 2)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t2) (table.get (i32.const 2)))))
|
||||
|
||||
(br_if $l (i32.eqz (ref.test $t3 (table.get (i32.const 3)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t3) (table.get (i32.const 3)))))
|
||||
|
||||
(br_if $l (i32.eqz (ref.test $t4 (table.get (i32.const 4)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t4) (table.get (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 (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 $t1 (table.get (i32.const 0))))
|
||||
(br_if $l (ref.test $t1 (table.get (i32.const 3))))
|
||||
(br_if $l (ref.test $t1 (table.get (i32.const 4))))
|
||||
(br_if $l (ref.test (ref $t1) (table.get (i32.const 0))))
|
||||
(br_if $l (ref.test (ref $t1) (table.get (i32.const 3))))
|
||||
(br_if $l (ref.test (ref $t1) (table.get (i32.const 4))))
|
||||
|
||||
(br_if $l (ref.test $t2 (table.get (i32.const 0))))
|
||||
(br_if $l (ref.test $t2 (table.get (i32.const 1))))
|
||||
(br_if $l (ref.test $t2 (table.get (i32.const 3))))
|
||||
(br_if $l (ref.test $t2 (table.get (i32.const 4))))
|
||||
(br_if $l (ref.test (ref $t2) (table.get (i32.const 0))))
|
||||
(br_if $l (ref.test (ref $t2) (table.get (i32.const 1))))
|
||||
(br_if $l (ref.test (ref $t2) (table.get (i32.const 3))))
|
||||
(br_if $l (ref.test (ref $t2) (table.get (i32.const 4))))
|
||||
|
||||
(br_if $l (ref.test $t3 (table.get (i32.const 0))))
|
||||
(br_if $l (ref.test $t3 (table.get (i32.const 1))))
|
||||
(br_if $l (ref.test $t3 (table.get (i32.const 2))))
|
||||
(br_if $l (ref.test $t3 (table.get (i32.const 4))))
|
||||
(br_if $l (ref.test (ref $t3) (table.get (i32.const 0))))
|
||||
(br_if $l (ref.test (ref $t3) (table.get (i32.const 1))))
|
||||
(br_if $l (ref.test (ref $t3) (table.get (i32.const 2))))
|
||||
(br_if $l (ref.test (ref $t3) (table.get (i32.const 4))))
|
||||
|
||||
(br_if $l (ref.test $t4 (table.get (i32.const 0))))
|
||||
(br_if $l (ref.test $t4 (table.get (i32.const 1))))
|
||||
(br_if $l (ref.test $t4 (table.get (i32.const 2))))
|
||||
(br_if $l (ref.test $t4 (table.get (i32.const 3))))
|
||||
(br_if $l (ref.test (ref $t4) (table.get (i32.const 0))))
|
||||
(br_if $l (ref.test (ref $t4) (table.get (i32.const 1))))
|
||||
(br_if $l (ref.test (ref $t4) (table.get (i32.const 2))))
|
||||
(br_if $l (ref.test (ref $t4) (table.get (i32.const 3))))
|
||||
|
||||
(return)
|
||||
)
|
||||
@ -119,25 +119,25 @@
|
||||
(func (export "test-canon")
|
||||
(call $init)
|
||||
(block $l
|
||||
(br_if $l (i32.eqz (ref.test $t0 (table.get (i32.const 0)))))
|
||||
(br_if $l (i32.eqz (ref.test $t0 (table.get (i32.const 1)))))
|
||||
(br_if $l (i32.eqz (ref.test $t0 (table.get (i32.const 2)))))
|
||||
(br_if $l (i32.eqz (ref.test $t0 (table.get (i32.const 3)))))
|
||||
(br_if $l (i32.eqz (ref.test $t0 (table.get (i32.const 4)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t0) (table.get (i32.const 0)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t0) (table.get (i32.const 1)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t0) (table.get (i32.const 2)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t0) (table.get (i32.const 3)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t0) (table.get (i32.const 4)))))
|
||||
|
||||
(br_if $l (i32.eqz (ref.test $t0 (table.get (i32.const 10)))))
|
||||
(br_if $l (i32.eqz (ref.test $t0 (table.get (i32.const 11)))))
|
||||
(br_if $l (i32.eqz (ref.test $t0 (table.get (i32.const 12)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t0) (table.get (i32.const 10)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t0) (table.get (i32.const 11)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t0) (table.get (i32.const 12)))))
|
||||
|
||||
(br_if $l (i32.eqz (ref.test $t1' (table.get (i32.const 1)))))
|
||||
(br_if $l (i32.eqz (ref.test $t1' (table.get (i32.const 2)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t1') (table.get (i32.const 1)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t1') (table.get (i32.const 2)))))
|
||||
|
||||
(br_if $l (i32.eqz (ref.test $t1 (table.get (i32.const 11)))))
|
||||
(br_if $l (i32.eqz (ref.test $t1 (table.get (i32.const 12)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t1) (table.get (i32.const 11)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t1) (table.get (i32.const 12)))))
|
||||
|
||||
(br_if $l (i32.eqz (ref.test $t2' (table.get (i32.const 2)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t2') (table.get (i32.const 2)))))
|
||||
|
||||
(br_if $l (i32.eqz (ref.test $t2 (table.get (i32.const 12)))))
|
||||
(br_if $l (i32.eqz (ref.test (ref $t2) (table.get (i32.const 12)))))
|
||||
|
||||
(return)
|
||||
)
|
||||
|
||||
Binary file not shown.
@ -10,10 +10,10 @@
|
||||
|
||||
(func (export "init") (param $x externref)
|
||||
(table.set (i32.const 0) (ref.null any))
|
||||
(table.set (i32.const 1) (i31.new (i32.const 7)))
|
||||
(table.set (i32.const 2) (struct.new_canon_default $st))
|
||||
(table.set (i32.const 3) (array.new_canon_default $at (i32.const 0)))
|
||||
(table.set (i32.const 4) (extern.internalize (local.get $x)))
|
||||
(table.set (i32.const 1) (ref.i31 (i32.const 7)))
|
||||
(table.set (i32.const 2) (struct.new_default $st))
|
||||
(table.set (i32.const 3) (array.new_default $at (i32.const 0)))
|
||||
(table.set (i32.const 4) (any.convert_extern (local.get $x)))
|
||||
(table.set (i32.const 5) (ref.null i31))
|
||||
(table.set (i32.const 6) (ref.null struct))
|
||||
(table.set (i32.const 7) (ref.null none))
|
||||
@ -21,26 +21,25 @@
|
||||
|
||||
(func (export "ref_cast_non_null") (param $i i32)
|
||||
(drop (ref.as_non_null (table.get (local.get $i))))
|
||||
(drop (ref.cast null any (table.get (local.get $i))))
|
||||
(drop (ref.cast (ref null any) (table.get (local.get $i))))
|
||||
)
|
||||
(func (export "ref_cast_null") (param $i i32)
|
||||
(drop (ref.cast null any (table.get (local.get $i))))
|
||||
(drop (ref.cast null struct (table.get (local.get $i))))
|
||||
(drop (ref.cast null array (table.get (local.get $i))))
|
||||
(drop (ref.cast null i31 (table.get (local.get $i))))
|
||||
(drop (ref.cast null none (table.get (local.get $i))))
|
||||
(drop (ref.cast anyref (table.get (local.get $i))))
|
||||
(drop (ref.cast structref (table.get (local.get $i))))
|
||||
(drop (ref.cast arrayref (table.get (local.get $i))))
|
||||
(drop (ref.cast i31ref (table.get (local.get $i))))
|
||||
(drop (ref.cast nullref (table.get (local.get $i))))
|
||||
)
|
||||
(func (export "ref_cast_i31") (param $i i32)
|
||||
(drop (ref.cast i31 (table.get (local.get $i))))
|
||||
(drop (ref.cast null i31 (table.get (local.get $i))))
|
||||
(drop (ref.cast (ref i31) (table.get (local.get $i))))
|
||||
(drop (ref.cast i31ref (table.get (local.get $i))))
|
||||
)
|
||||
(func (export "ref_cast_struct") (param $i i32)
|
||||
(drop (ref.cast struct (table.get (local.get $i))))
|
||||
(drop (ref.cast null struct (table.get (local.get $i))))
|
||||
(drop (ref.cast (ref struct) (table.get (local.get $i))))
|
||||
(drop (ref.cast structref (table.get (local.get $i))))
|
||||
)
|
||||
(func (export "ref_cast_array") (param $i i32)
|
||||
(drop (ref.cast array (table.get (local.get $i))))
|
||||
(drop (ref.cast null array (table.get (local.get $i))))
|
||||
(drop (ref.cast (ref array) (table.get (local.get $i))))
|
||||
(drop (ref.cast arrayref (table.get (local.get $i))))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Binary file not shown.
@ -11,75 +11,75 @@
|
||||
(table 20 (ref null struct))
|
||||
|
||||
(func $init
|
||||
(table.set (i32.const 0) (struct.new_canon_default $t0))
|
||||
(table.set (i32.const 10) (struct.new_canon_default $t0))
|
||||
(table.set (i32.const 1) (struct.new_canon_default $t1))
|
||||
(table.set (i32.const 11) (struct.new_canon_default $t1'))
|
||||
(table.set (i32.const 2) (struct.new_canon_default $t2))
|
||||
(table.set (i32.const 12) (struct.new_canon_default $t2'))
|
||||
(table.set (i32.const 3) (struct.new_canon_default $t3))
|
||||
(table.set (i32.const 4) (struct.new_canon_default $t4))
|
||||
(table.set (i32.const 0) (struct.new_default $t0))
|
||||
(table.set (i32.const 10) (struct.new_default $t0))
|
||||
(table.set (i32.const 1) (struct.new_default $t1))
|
||||
(table.set (i32.const 11) (struct.new_default $t1'))
|
||||
(table.set (i32.const 2) (struct.new_default $t2))
|
||||
(table.set (i32.const 12) (struct.new_default $t2'))
|
||||
(table.set (i32.const 3) (struct.new_default $t3))
|
||||
(table.set (i32.const 4) (struct.new_default $t4))
|
||||
)
|
||||
|
||||
(func (export "test-sub")
|
||||
(call $init)
|
||||
|
||||
(drop (ref.cast null $t0 (ref.null struct)))
|
||||
(drop (ref.cast null $t0 (table.get (i32.const 0))))
|
||||
(drop (ref.cast null $t0 (table.get (i32.const 1))))
|
||||
(drop (ref.cast null $t0 (table.get (i32.const 2))))
|
||||
(drop (ref.cast null $t0 (table.get (i32.const 3))))
|
||||
(drop (ref.cast null $t0 (table.get (i32.const 4))))
|
||||
(drop (ref.cast (ref null $t0) (ref.null struct)))
|
||||
(drop (ref.cast (ref null $t0) (table.get (i32.const 0))))
|
||||
(drop (ref.cast (ref null $t0) (table.get (i32.const 1))))
|
||||
(drop (ref.cast (ref null $t0) (table.get (i32.const 2))))
|
||||
(drop (ref.cast (ref null $t0) (table.get (i32.const 3))))
|
||||
(drop (ref.cast (ref null $t0) (table.get (i32.const 4))))
|
||||
|
||||
(drop (ref.cast null $t0 (ref.null struct)))
|
||||
(drop (ref.cast null $t1 (table.get (i32.const 1))))
|
||||
(drop (ref.cast null $t1 (table.get (i32.const 2))))
|
||||
(drop (ref.cast (ref null $t0) (ref.null struct)))
|
||||
(drop (ref.cast (ref null $t1) (table.get (i32.const 1))))
|
||||
(drop (ref.cast (ref null $t1) (table.get (i32.const 2))))
|
||||
|
||||
(drop (ref.cast null $t0 (ref.null struct)))
|
||||
(drop (ref.cast null $t2 (table.get (i32.const 2))))
|
||||
(drop (ref.cast (ref null $t0) (ref.null struct)))
|
||||
(drop (ref.cast (ref null $t2) (table.get (i32.const 2))))
|
||||
|
||||
(drop (ref.cast null $t0 (ref.null struct)))
|
||||
(drop (ref.cast null $t3 (table.get (i32.const 3))))
|
||||
(drop (ref.cast (ref null $t0) (ref.null struct)))
|
||||
(drop (ref.cast (ref null $t3) (table.get (i32.const 3))))
|
||||
|
||||
(drop (ref.cast null $t4 (table.get (i32.const 4))))
|
||||
(drop (ref.cast (ref null $t4) (table.get (i32.const 4))))
|
||||
|
||||
(drop (ref.cast $t0 (table.get (i32.const 0))))
|
||||
(drop (ref.cast $t0 (table.get (i32.const 1))))
|
||||
(drop (ref.cast $t0 (table.get (i32.const 2))))
|
||||
(drop (ref.cast $t0 (table.get (i32.const 3))))
|
||||
(drop (ref.cast $t0 (table.get (i32.const 4))))
|
||||
(drop (ref.cast (ref $t0) (table.get (i32.const 0))))
|
||||
(drop (ref.cast (ref $t0) (table.get (i32.const 1))))
|
||||
(drop (ref.cast (ref $t0) (table.get (i32.const 2))))
|
||||
(drop (ref.cast (ref $t0) (table.get (i32.const 3))))
|
||||
(drop (ref.cast (ref $t0) (table.get (i32.const 4))))
|
||||
|
||||
(drop (ref.cast $t1 (table.get (i32.const 1))))
|
||||
(drop (ref.cast $t1 (table.get (i32.const 2))))
|
||||
(drop (ref.cast (ref $t1) (table.get (i32.const 1))))
|
||||
(drop (ref.cast (ref $t1) (table.get (i32.const 2))))
|
||||
|
||||
(drop (ref.cast $t2 (table.get (i32.const 2))))
|
||||
(drop (ref.cast (ref $t2) (table.get (i32.const 2))))
|
||||
|
||||
(drop (ref.cast $t3 (table.get (i32.const 3))))
|
||||
(drop (ref.cast (ref $t3) (table.get (i32.const 3))))
|
||||
|
||||
(drop (ref.cast $t4 (table.get (i32.const 4))))
|
||||
(drop (ref.cast (ref $t4) (table.get (i32.const 4))))
|
||||
)
|
||||
|
||||
(func (export "test-canon")
|
||||
(call $init)
|
||||
|
||||
(drop (ref.cast $t0 (table.get (i32.const 0))))
|
||||
(drop (ref.cast $t0 (table.get (i32.const 1))))
|
||||
(drop (ref.cast $t0 (table.get (i32.const 2))))
|
||||
(drop (ref.cast $t0 (table.get (i32.const 3))))
|
||||
(drop (ref.cast $t0 (table.get (i32.const 4))))
|
||||
(drop (ref.cast (ref $t0) (table.get (i32.const 0))))
|
||||
(drop (ref.cast (ref $t0) (table.get (i32.const 1))))
|
||||
(drop (ref.cast (ref $t0) (table.get (i32.const 2))))
|
||||
(drop (ref.cast (ref $t0) (table.get (i32.const 3))))
|
||||
(drop (ref.cast (ref $t0) (table.get (i32.const 4))))
|
||||
|
||||
(drop (ref.cast $t0 (table.get (i32.const 10))))
|
||||
(drop (ref.cast $t0 (table.get (i32.const 11))))
|
||||
(drop (ref.cast $t0 (table.get (i32.const 12))))
|
||||
(drop (ref.cast (ref $t0) (table.get (i32.const 10))))
|
||||
(drop (ref.cast (ref $t0) (table.get (i32.const 11))))
|
||||
(drop (ref.cast (ref $t0) (table.get (i32.const 12))))
|
||||
|
||||
(drop (ref.cast $t1' (table.get (i32.const 1))))
|
||||
(drop (ref.cast $t1' (table.get (i32.const 2))))
|
||||
(drop (ref.cast (ref $t1') (table.get (i32.const 1))))
|
||||
(drop (ref.cast (ref $t1') (table.get (i32.const 2))))
|
||||
|
||||
(drop (ref.cast $t1 (table.get (i32.const 11))))
|
||||
(drop (ref.cast $t1 (table.get (i32.const 12))))
|
||||
(drop (ref.cast (ref $t1) (table.get (i32.const 11))))
|
||||
(drop (ref.cast (ref $t1) (table.get (i32.const 12))))
|
||||
|
||||
(drop (ref.cast $t2' (table.get (i32.const 2))))
|
||||
(drop (ref.cast (ref $t2') (table.get (i32.const 2))))
|
||||
|
||||
(drop (ref.cast $t2 (table.get (i32.const 12))))
|
||||
(drop (ref.cast (ref $t2) (table.get (i32.const 12))))
|
||||
)
|
||||
)
|
||||
|
||||
Binary file not shown.
@ -12,13 +12,13 @@
|
||||
(func (export "init")
|
||||
(table.set (i32.const 0) (ref.null eq))
|
||||
(table.set (i32.const 1) (ref.null i31))
|
||||
(table.set (i32.const 2) (i31.new (i32.const 7)))
|
||||
(table.set (i32.const 3) (i31.new (i32.const 7)))
|
||||
(table.set (i32.const 4) (i31.new (i32.const 8)))
|
||||
(table.set (i32.const 5) (struct.new_canon_default $st))
|
||||
(table.set (i32.const 6) (struct.new_canon_default $st))
|
||||
(table.set (i32.const 7) (array.new_canon_default $at (i32.const 0)))
|
||||
(table.set (i32.const 8) (array.new_canon_default $at (i32.const 0)))
|
||||
(table.set (i32.const 2) (ref.i31 (i32.const 7)))
|
||||
(table.set (i32.const 3) (ref.i31 (i32.const 7)))
|
||||
(table.set (i32.const 4) (ref.i31 (i32.const 8)))
|
||||
(table.set (i32.const 5) (struct.new_default $st))
|
||||
(table.set (i32.const 6) (struct.new_default $st))
|
||||
(table.set (i32.const 7) (array.new_default $at (i32.const 0)))
|
||||
(table.set (i32.const 8) (array.new_default $at (i32.const 0)))
|
||||
)
|
||||
|
||||
(func (export "eq") (param $i i32) (param $j i32) (result i32)
|
||||
|
||||
Reference in New Issue
Block a user