File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 675
675
676
676
(assert_return (invoke $m " get" (i32.const 0 )) (ref.null extern ))
677
677
(assert_return (invoke $m " get" (i32.const 1 )) (ref.extern 137 ))
678
+
679
+ ;; Initializing a table with imported funcref global
680
+
681
+ (module $module4
682
+ (func (result i32 )
683
+ i32.const 42
684
+ )
685
+ (global (export " f" ) funcref (ref.func 0 ))
686
+ )
687
+
688
+ (register " module4" $module4 )
689
+
690
+ (module
691
+ (import " module4" " f" (global funcref ))
692
+ (type $out-i32 (func (result i32 )))
693
+ (table 10 funcref )
694
+ (elem (offset (i32.const 0 )) funcref (global.get 0 ))
695
+ (func (export " call_imported_elem" ) (type $out-i32 )
696
+ (call_indirect (type $out-i32 ) (i32.const 0 ))
697
+ )
698
+ )
699
+
700
+ (assert_return (invoke " call_imported_elem" ) (i32.const 42 ))
You can’t perform that action at this time.
0 commit comments