(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_non_null" (func 2)) (export "br_on_non_i31" (func 3)) (export "br_on_non_struct" (func 4)) (export "br_on_non_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 (result (ref any)) local.get $i table.get 0 br_on_non_null $l i32.const 0 return end i32.const -1 return ) (func (;3;) (type 4) (param $i i32) (result i32) block $l (result anyref) local.get $i table.get 0 br_on_cast_fail $l anyref (ref i31) i31.get_u return end i32.const -1 return ) (func (;4;) (type 4) (param $i i32) (result i32) block $l (result anyref) local.get $i table.get 0 br_on_cast_fail $l anyref (ref struct) 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 return end i32.const -1 return ) (func (;5;) (type 4) (param $i i32) (result i32) block $l (result anyref) local.get $i table.get 0 br_on_cast_fail $l anyref (ref array) array.len return end i32.const -1 return ) (func (;6;) (type 4) (param $i i32) (result i32) block $l (result (ref any)) block (result structref) ;; label = @2 local.get $i table.get 0 br_on_cast_fail $l anyref structref end i32.const 1 return end i32.const 0 return ) )