Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions test/core/elem.wast
Original file line number Diff line number Diff line change
Expand Up @@ -675,3 +675,26 @@

(assert_return (invoke $m "get" (i32.const 0)) (ref.null extern))
(assert_return (invoke $m "get" (i32.const 1)) (ref.extern 137))

;; Initializing a table with imported funcref global

(module $module4
(func (result i32)
i32.const 42
)
(global (export "f") funcref (ref.func 0))
)

(register "module4" $module4)

(module
(import "module4" "f" (global funcref))
(type $out-i32 (func (result i32)))
(table 10 funcref)
(elem (offset (i32.const 0)) funcref (global.get 0))
(func (export "call_imported_elem") (type $out-i32)
(call_indirect (type $out-i32) (i32.const 0))
)
)

(assert_return (invoke "call_imported_elem") (i32.const 42))