diff --git a/test/core/table.wast b/test/core/table.wast index 1142c784..a11dce56 100644 --- a/test/core/table.wast +++ b/test/core/table.wast @@ -78,21 +78,36 @@ ;; Table initializer (module + (global (export "g") (ref $f) (ref.func $f)) + (type $f (func)) + (func $f) +) +(register "M") + +(module + (global $g (import "M" "g") (ref $dummy)) + (type $dummy (func)) (func $dummy) (table $t1 10 funcref) (table $t2 10 funcref (ref.func $dummy)) (table $t3 10 (ref $dummy) (ref.func $dummy)) + (table $t4 10 funcref (global.get $g)) + (table $t5 10 (ref $dummy) (global.get $g)) (func (export "get1") (result funcref) (table.get $t1 (i32.const 1))) (func (export "get2") (result funcref) (table.get $t2 (i32.const 4))) (func (export "get3") (result funcref) (table.get $t3 (i32.const 7))) + (func (export "get4") (result funcref) (table.get $t4 (i32.const 8))) + (func (export "get5") (result funcref) (table.get $t5 (i32.const 9))) ) (assert_return (invoke "get1") (ref.null)) (assert_return (invoke "get2") (ref.func)) (assert_return (invoke "get3") (ref.func)) +(assert_return (invoke "get4") (ref.func)) +(assert_return (invoke "get5") (ref.func)) (assert_invalid