1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
|
;; Test TypeBuilder
Before setting heap types:
$sig => (; temp ;) (func_subtype func)
$struct => (; temp ;) (func_subtype func)
$array => (; temp ;) (func_subtype func)
(ref $sig) => (; temp ;) (ref $0)
(ref $struct) => (; temp ;) (ref $1)
(ref $array) => (; temp ;) (ref $2)
(ref null $array) => (; temp ;) (ref null $2)
(rtt 0 $array) => (; temp ;) (rtt 0 $2)
After setting heap types:
$sig => (; temp ;) (func_subtype (param (; temp ;) (ref $1)) (result (; temp ;) (ref $2) i32) func)
$struct => (; temp ;) (struct_subtype (field (; temp ;) (ref null $2) (mut (; temp ;) (rtt 0 $2))) data)
$array => (; temp ;) (array_subtype (mut anyref) data)
(ref $sig) => (; temp ;) (ref $0)
(ref $struct) => (; temp ;) (ref $1)
(ref $array) => (; temp ;) (ref $2)
(ref null $array) => (; temp ;) (ref null $2)
(rtt 0 $array) => (; temp ;) (rtt 0 $2)
After building types:
$sig => (func_subtype (param (ref $1)) (result (ref $2) i32) func)
$struct => (struct_subtype (field (ref null $2) (mut (rtt 0 $2))) data)
$array => (array_subtype (mut anyref) data)
(ref $sig) => (ref $0)
(ref $struct) => (ref $1)
(ref $array) => (ref $2)
(ref null $array) => (ref null $2)
(rtt 0 $array) => (rtt 0 $2)
;; Test canonicalization
;; Test basic
;; Test canonical signatures
;; Test recursive types
(func_subtype (result (ref null $0)) func)
(func_subtype (result (ref null $1)) func)
(func_subtype (result (ref null $0)) func)
(func_subtype (result (ref null $1)) func)
(func_subtype (result (ref null $2)) func)
(func_subtype (result (ref null $3)) func)
(func_subtype (result (ref null $4)) func)
(func_subtype (result (ref null $0)) func)
(func_subtype (result (ref null $0) (ref null $2)) func)
(func_subtype (result (ref null $1) (ref null $3)) func)
(func_subtype func)
(func_subtype func)
(func_subtype (result (ref null $0)) func)
(func_subtype (result (ref null $1)) func)
(func_subtype (result (ref null $0)) func)
(func_subtype (result (ref null $0)) func)
;; Test subtyping
;; Test TypeBuilder
Before setting heap types:
$sig => (; temp ;) (func_subtype func)
$struct => (; temp ;) (func_subtype func)
$array => (; temp ;) (func_subtype func)
(ref $sig) => (; temp ;) (ref $0)
(ref $struct) => (; temp ;) (ref $1)
(ref $array) => (; temp ;) (ref $2)
(ref null $array) => (; temp ;) (ref null $2)
(rtt 0 $array) => (; temp ;) (rtt 0 $2)
After setting heap types:
$sig => (; temp ;) (func_subtype (param (; temp ;) (ref $1)) (result (; temp ;) (ref $2) i32) func)
$struct => (; temp ;) (struct_subtype (field (; temp ;) (ref null $2) (mut (; temp ;) (rtt 0 $2))) data)
$array => (; temp ;) (array_subtype (mut anyref) data)
(ref $sig) => (; temp ;) (ref $0)
(ref $struct) => (; temp ;) (ref $1)
(ref $array) => (; temp ;) (ref $2)
(ref null $array) => (; temp ;) (ref null $2)
(rtt 0 $array) => (; temp ;) (rtt 0 $2)
After building types:
$sig => (func_subtype (param (ref $1)) (result (ref $2) i32) func)
$struct => (struct_subtype (field (ref null $2) (mut (rtt 0 $2))) data)
$array => (array_subtype (mut anyref) data)
(ref $sig) => (ref $0)
(ref $struct) => (ref $1)
(ref $array) => (ref $2)
(ref null $array) => (ref null $2)
(rtt 0 $array) => (rtt 0 $2)
;; Test canonicalization
;; Test basic
;; Test canonical signatures
;; Test recursive types
(func_subtype (result (ref null $0)) func)
(func_subtype (result (ref null $1)) func)
(func_subtype (result (ref null $0)) func)
(func_subtype (result (ref null $1)) func)
(func_subtype (result (ref null $2)) func)
(func_subtype (result (ref null $3)) func)
(func_subtype (result (ref null $4)) func)
(func_subtype (result (ref null $0)) func)
(func_subtype (result (ref null $0) (ref null $2)) func)
(func_subtype (result (ref null $1) (ref null $3)) func)
(func_subtype func)
(func_subtype func)
(func_subtype (result (ref null $0)) func)
(func_subtype (result (ref null $1)) func)
(func_subtype (result (ref null $0)) func)
(func_subtype (result (ref null $0)) func)
;; Test subtyping
|