(module (type $ft (;0;) (func (result i32))) (type $st (;1;) (struct (field i16))) (type $at (;2;) (array i8)) (type (;3;) (func (param externref))) (type (;4;) (func (param i32) (result i32))) (type (;5;) (func (param structref) (result (ref $st)))) (type (;6;) (func (param structref) (result (ref $at)))) (table (;0;) 10 anyref) (export "init" (func 1)) (export "br_on_null" (func 2)) (export "br_on_i31" (func 3)) (export "br_on_struct" (func 4)) (export "br_on_array" (func 5)) (export "null-diff" (func 6)) (elem (;0;) declare func $f) (func $f (;0;) (type $ft) (result i32) i32.const 9 ) (func (;1;) (type 3) (param $x externref) i32.const 0 ref.null any table.set 0 i32.const 1 i32.const 7 ref.i31 table.set 0 i32.const 2 i32.const 6 struct.new $st table.set 0 i32.const 3 i32.const 5 i32.const 3 array.new $at table.set 0 i32.const 4 local.get $x any.convert_extern table.set 0 ) (func (;2;) (type 4) (param $i i32) (result i32) block $l local.get $i table.get 0 br_on_null $l i32.const -1 return end i32.const 0 ) (func (;3;) (type 4) (param $i i32) (result i32) block $l (result (ref i31)) local.get $i table.get 0 br_on_cast $l anyref (ref i31) i32.const -1 return end i31.get_u ) (func (;4;) (type 4) (param $i i32) (result i32) block $l (result (ref struct)) local.get $i table.get 0 br_on_cast $l anyref (ref struct) i32.const -1 return end block $l2 (type 5) (param structref) (result (ref $st)) block $l3 (type 6) (param structref) (result (ref $at)) br_on_cast $l2 structref (ref $st) br_on_cast $l3 anyref (ref $at) i32.const -2 return end i32.const 0 array.get_u $at return end struct.get_s $st 0 ) (func (;5;) (type 4) (param $i i32) (result i32) block $l (result (ref array)) local.get $i table.get 0 br_on_cast $l anyref (ref array) i32.const -1 return end array.len ) (func (;6;) (type 4) (param $i i32) (result i32) block $l (result structref) block (result (ref any)) ;; label = @2 local.get $i table.get 0 br_on_cast $l anyref structref end i32.const 0 return end i32.const 1 return ) )