Update unit test cases (#4214)

* Update gc unit test cases
* Update aot stack frame unit test cases
This commit is contained in:
Zhenwei Jin
2025-04-25 14:43:24 +08:00
committed by GitHub
parent c883fafead
commit 6d61e72344
21 changed files with 237 additions and 277 deletions

View File

@ -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)))
)
)
)