wa-lang.org/wazero@v1.0.2/internal/integration_test/spectest/v2/testdata/i32.wast (about) 1 ;; i32 operations 2 3 (module 4 (func (export "add") (param $x i32) (param $y i32) (result i32) (i32.add (local.get $x) (local.get $y))) 5 (func (export "sub") (param $x i32) (param $y i32) (result i32) (i32.sub (local.get $x) (local.get $y))) 6 (func (export "mul") (param $x i32) (param $y i32) (result i32) (i32.mul (local.get $x) (local.get $y))) 7 (func (export "div_s") (param $x i32) (param $y i32) (result i32) (i32.div_s (local.get $x) (local.get $y))) 8 (func (export "div_u") (param $x i32) (param $y i32) (result i32) (i32.div_u (local.get $x) (local.get $y))) 9 (func (export "rem_s") (param $x i32) (param $y i32) (result i32) (i32.rem_s (local.get $x) (local.get $y))) 10 (func (export "rem_u") (param $x i32) (param $y i32) (result i32) (i32.rem_u (local.get $x) (local.get $y))) 11 (func (export "and") (param $x i32) (param $y i32) (result i32) (i32.and (local.get $x) (local.get $y))) 12 (func (export "or") (param $x i32) (param $y i32) (result i32) (i32.or (local.get $x) (local.get $y))) 13 (func (export "xor") (param $x i32) (param $y i32) (result i32) (i32.xor (local.get $x) (local.get $y))) 14 (func (export "shl") (param $x i32) (param $y i32) (result i32) (i32.shl (local.get $x) (local.get $y))) 15 (func (export "shr_s") (param $x i32) (param $y i32) (result i32) (i32.shr_s (local.get $x) (local.get $y))) 16 (func (export "shr_u") (param $x i32) (param $y i32) (result i32) (i32.shr_u (local.get $x) (local.get $y))) 17 (func (export "rotl") (param $x i32) (param $y i32) (result i32) (i32.rotl (local.get $x) (local.get $y))) 18 (func (export "rotr") (param $x i32) (param $y i32) (result i32) (i32.rotr (local.get $x) (local.get $y))) 19 (func (export "clz") (param $x i32) (result i32) (i32.clz (local.get $x))) 20 (func (export "ctz") (param $x i32) (result i32) (i32.ctz (local.get $x))) 21 (func (export "popcnt") (param $x i32) (result i32) (i32.popcnt (local.get $x))) 22 (func (export "extend8_s") (param $x i32) (result i32) (i32.extend8_s (local.get $x))) 23 (func (export "extend16_s") (param $x i32) (result i32) (i32.extend16_s (local.get $x))) 24 (func (export "eqz") (param $x i32) (result i32) (i32.eqz (local.get $x))) 25 (func (export "eq") (param $x i32) (param $y i32) (result i32) (i32.eq (local.get $x) (local.get $y))) 26 (func (export "ne") (param $x i32) (param $y i32) (result i32) (i32.ne (local.get $x) (local.get $y))) 27 (func (export "lt_s") (param $x i32) (param $y i32) (result i32) (i32.lt_s (local.get $x) (local.get $y))) 28 (func (export "lt_u") (param $x i32) (param $y i32) (result i32) (i32.lt_u (local.get $x) (local.get $y))) 29 (func (export "le_s") (param $x i32) (param $y i32) (result i32) (i32.le_s (local.get $x) (local.get $y))) 30 (func (export "le_u") (param $x i32) (param $y i32) (result i32) (i32.le_u (local.get $x) (local.get $y))) 31 (func (export "gt_s") (param $x i32) (param $y i32) (result i32) (i32.gt_s (local.get $x) (local.get $y))) 32 (func (export "gt_u") (param $x i32) (param $y i32) (result i32) (i32.gt_u (local.get $x) (local.get $y))) 33 (func (export "ge_s") (param $x i32) (param $y i32) (result i32) (i32.ge_s (local.get $x) (local.get $y))) 34 (func (export "ge_u") (param $x i32) (param $y i32) (result i32) (i32.ge_u (local.get $x) (local.get $y))) 35 ) 36 37 (assert_return (invoke "add" (i32.const 1) (i32.const 1)) (i32.const 2)) 38 (assert_return (invoke "add" (i32.const 1) (i32.const 0)) (i32.const 1)) 39 (assert_return (invoke "add" (i32.const -1) (i32.const -1)) (i32.const -2)) 40 (assert_return (invoke "add" (i32.const -1) (i32.const 1)) (i32.const 0)) 41 (assert_return (invoke "add" (i32.const 0x7fffffff) (i32.const 1)) (i32.const 0x80000000)) 42 (assert_return (invoke "add" (i32.const 0x80000000) (i32.const -1)) (i32.const 0x7fffffff)) 43 (assert_return (invoke "add" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0)) 44 (assert_return (invoke "add" (i32.const 0x3fffffff) (i32.const 1)) (i32.const 0x40000000)) 45 46 (assert_return (invoke "sub" (i32.const 1) (i32.const 1)) (i32.const 0)) 47 (assert_return (invoke "sub" (i32.const 1) (i32.const 0)) (i32.const 1)) 48 (assert_return (invoke "sub" (i32.const -1) (i32.const -1)) (i32.const 0)) 49 (assert_return (invoke "sub" (i32.const 0x7fffffff) (i32.const -1)) (i32.const 0x80000000)) 50 (assert_return (invoke "sub" (i32.const 0x80000000) (i32.const 1)) (i32.const 0x7fffffff)) 51 (assert_return (invoke "sub" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0)) 52 (assert_return (invoke "sub" (i32.const 0x3fffffff) (i32.const -1)) (i32.const 0x40000000)) 53 54 (assert_return (invoke "mul" (i32.const 1) (i32.const 1)) (i32.const 1)) 55 (assert_return (invoke "mul" (i32.const 1) (i32.const 0)) (i32.const 0)) 56 (assert_return (invoke "mul" (i32.const -1) (i32.const -1)) (i32.const 1)) 57 (assert_return (invoke "mul" (i32.const 0x10000000) (i32.const 4096)) (i32.const 0)) 58 (assert_return (invoke "mul" (i32.const 0x80000000) (i32.const 0)) (i32.const 0)) 59 (assert_return (invoke "mul" (i32.const 0x80000000) (i32.const -1)) (i32.const 0x80000000)) 60 (assert_return (invoke "mul" (i32.const 0x7fffffff) (i32.const -1)) (i32.const 0x80000001)) 61 (assert_return (invoke "mul" (i32.const 0x01234567) (i32.const 0x76543210)) (i32.const 0x358e7470)) 62 (assert_return (invoke "mul" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 1)) 63 64 (assert_trap (invoke "div_s" (i32.const 1) (i32.const 0)) "integer divide by zero") 65 (assert_trap (invoke "div_s" (i32.const 0) (i32.const 0)) "integer divide by zero") 66 (assert_trap (invoke "div_s" (i32.const 0x80000000) (i32.const -1)) "integer overflow") 67 (assert_trap (invoke "div_s" (i32.const 0x80000000) (i32.const 0)) "integer divide by zero") 68 (assert_return (invoke "div_s" (i32.const 1) (i32.const 1)) (i32.const 1)) 69 (assert_return (invoke "div_s" (i32.const 0) (i32.const 1)) (i32.const 0)) 70 (assert_return (invoke "div_s" (i32.const 0) (i32.const -1)) (i32.const 0)) 71 (assert_return (invoke "div_s" (i32.const -1) (i32.const -1)) (i32.const 1)) 72 (assert_return (invoke "div_s" (i32.const 0x80000000) (i32.const 2)) (i32.const 0xc0000000)) 73 (assert_return (invoke "div_s" (i32.const 0x80000001) (i32.const 1000)) (i32.const 0xffdf3b65)) 74 (assert_return (invoke "div_s" (i32.const 5) (i32.const 2)) (i32.const 2)) 75 (assert_return (invoke "div_s" (i32.const -5) (i32.const 2)) (i32.const -2)) 76 (assert_return (invoke "div_s" (i32.const 5) (i32.const -2)) (i32.const -2)) 77 (assert_return (invoke "div_s" (i32.const -5) (i32.const -2)) (i32.const 2)) 78 (assert_return (invoke "div_s" (i32.const 7) (i32.const 3)) (i32.const 2)) 79 (assert_return (invoke "div_s" (i32.const -7) (i32.const 3)) (i32.const -2)) 80 (assert_return (invoke "div_s" (i32.const 7) (i32.const -3)) (i32.const -2)) 81 (assert_return (invoke "div_s" (i32.const -7) (i32.const -3)) (i32.const 2)) 82 (assert_return (invoke "div_s" (i32.const 11) (i32.const 5)) (i32.const 2)) 83 (assert_return (invoke "div_s" (i32.const 17) (i32.const 7)) (i32.const 2)) 84 85 (assert_trap (invoke "div_u" (i32.const 1) (i32.const 0)) "integer divide by zero") 86 (assert_trap (invoke "div_u" (i32.const 0) (i32.const 0)) "integer divide by zero") 87 (assert_return (invoke "div_u" (i32.const 1) (i32.const 1)) (i32.const 1)) 88 (assert_return (invoke "div_u" (i32.const 0) (i32.const 1)) (i32.const 0)) 89 (assert_return (invoke "div_u" (i32.const -1) (i32.const -1)) (i32.const 1)) 90 (assert_return (invoke "div_u" (i32.const 0x80000000) (i32.const -1)) (i32.const 0)) 91 (assert_return (invoke "div_u" (i32.const 0x80000000) (i32.const 2)) (i32.const 0x40000000)) 92 (assert_return (invoke "div_u" (i32.const 0x8ff00ff0) (i32.const 0x10001)) (i32.const 0x8fef)) 93 (assert_return (invoke "div_u" (i32.const 0x80000001) (i32.const 1000)) (i32.const 0x20c49b)) 94 (assert_return (invoke "div_u" (i32.const 5) (i32.const 2)) (i32.const 2)) 95 (assert_return (invoke "div_u" (i32.const -5) (i32.const 2)) (i32.const 0x7ffffffd)) 96 (assert_return (invoke "div_u" (i32.const 5) (i32.const -2)) (i32.const 0)) 97 (assert_return (invoke "div_u" (i32.const -5) (i32.const -2)) (i32.const 0)) 98 (assert_return (invoke "div_u" (i32.const 7) (i32.const 3)) (i32.const 2)) 99 (assert_return (invoke "div_u" (i32.const 11) (i32.const 5)) (i32.const 2)) 100 (assert_return (invoke "div_u" (i32.const 17) (i32.const 7)) (i32.const 2)) 101 102 (assert_trap (invoke "rem_s" (i32.const 1) (i32.const 0)) "integer divide by zero") 103 (assert_trap (invoke "rem_s" (i32.const 0) (i32.const 0)) "integer divide by zero") 104 (assert_return (invoke "rem_s" (i32.const 0x7fffffff) (i32.const -1)) (i32.const 0)) 105 (assert_return (invoke "rem_s" (i32.const 1) (i32.const 1)) (i32.const 0)) 106 (assert_return (invoke "rem_s" (i32.const 0) (i32.const 1)) (i32.const 0)) 107 (assert_return (invoke "rem_s" (i32.const 0) (i32.const -1)) (i32.const 0)) 108 (assert_return (invoke "rem_s" (i32.const -1) (i32.const -1)) (i32.const 0)) 109 (assert_return (invoke "rem_s" (i32.const 0x80000000) (i32.const -1)) (i32.const 0)) 110 (assert_return (invoke "rem_s" (i32.const 0x80000000) (i32.const 2)) (i32.const 0)) 111 (assert_return (invoke "rem_s" (i32.const 0x80000001) (i32.const 1000)) (i32.const -647)) 112 (assert_return (invoke "rem_s" (i32.const 5) (i32.const 2)) (i32.const 1)) 113 (assert_return (invoke "rem_s" (i32.const -5) (i32.const 2)) (i32.const -1)) 114 (assert_return (invoke "rem_s" (i32.const 5) (i32.const -2)) (i32.const 1)) 115 (assert_return (invoke "rem_s" (i32.const -5) (i32.const -2)) (i32.const -1)) 116 (assert_return (invoke "rem_s" (i32.const 7) (i32.const 3)) (i32.const 1)) 117 (assert_return (invoke "rem_s" (i32.const -7) (i32.const 3)) (i32.const -1)) 118 (assert_return (invoke "rem_s" (i32.const 7) (i32.const -3)) (i32.const 1)) 119 (assert_return (invoke "rem_s" (i32.const -7) (i32.const -3)) (i32.const -1)) 120 (assert_return (invoke "rem_s" (i32.const 11) (i32.const 5)) (i32.const 1)) 121 (assert_return (invoke "rem_s" (i32.const 17) (i32.const 7)) (i32.const 3)) 122 123 (assert_trap (invoke "rem_u" (i32.const 1) (i32.const 0)) "integer divide by zero") 124 (assert_trap (invoke "rem_u" (i32.const 0) (i32.const 0)) "integer divide by zero") 125 (assert_return (invoke "rem_u" (i32.const 1) (i32.const 1)) (i32.const 0)) 126 (assert_return (invoke "rem_u" (i32.const 0) (i32.const 1)) (i32.const 0)) 127 (assert_return (invoke "rem_u" (i32.const -1) (i32.const -1)) (i32.const 0)) 128 (assert_return (invoke "rem_u" (i32.const 0x80000000) (i32.const -1)) (i32.const 0x80000000)) 129 (assert_return (invoke "rem_u" (i32.const 0x80000000) (i32.const 2)) (i32.const 0)) 130 (assert_return (invoke "rem_u" (i32.const 0x8ff00ff0) (i32.const 0x10001)) (i32.const 0x8001)) 131 (assert_return (invoke "rem_u" (i32.const 0x80000001) (i32.const 1000)) (i32.const 649)) 132 (assert_return (invoke "rem_u" (i32.const 5) (i32.const 2)) (i32.const 1)) 133 (assert_return (invoke "rem_u" (i32.const -5) (i32.const 2)) (i32.const 1)) 134 (assert_return (invoke "rem_u" (i32.const 5) (i32.const -2)) (i32.const 5)) 135 (assert_return (invoke "rem_u" (i32.const -5) (i32.const -2)) (i32.const -5)) 136 (assert_return (invoke "rem_u" (i32.const 7) (i32.const 3)) (i32.const 1)) 137 (assert_return (invoke "rem_u" (i32.const 11) (i32.const 5)) (i32.const 1)) 138 (assert_return (invoke "rem_u" (i32.const 17) (i32.const 7)) (i32.const 3)) 139 140 (assert_return (invoke "and" (i32.const 1) (i32.const 0)) (i32.const 0)) 141 (assert_return (invoke "and" (i32.const 0) (i32.const 1)) (i32.const 0)) 142 (assert_return (invoke "and" (i32.const 1) (i32.const 1)) (i32.const 1)) 143 (assert_return (invoke "and" (i32.const 0) (i32.const 0)) (i32.const 0)) 144 (assert_return (invoke "and" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 0)) 145 (assert_return (invoke "and" (i32.const 0x7fffffff) (i32.const -1)) (i32.const 0x7fffffff)) 146 (assert_return (invoke "and" (i32.const 0xf0f0ffff) (i32.const 0xfffff0f0)) (i32.const 0xf0f0f0f0)) 147 (assert_return (invoke "and" (i32.const 0xffffffff) (i32.const 0xffffffff)) (i32.const 0xffffffff)) 148 149 (assert_return (invoke "or" (i32.const 1) (i32.const 0)) (i32.const 1)) 150 (assert_return (invoke "or" (i32.const 0) (i32.const 1)) (i32.const 1)) 151 (assert_return (invoke "or" (i32.const 1) (i32.const 1)) (i32.const 1)) 152 (assert_return (invoke "or" (i32.const 0) (i32.const 0)) (i32.const 0)) 153 (assert_return (invoke "or" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const -1)) 154 (assert_return (invoke "or" (i32.const 0x80000000) (i32.const 0)) (i32.const 0x80000000)) 155 (assert_return (invoke "or" (i32.const 0xf0f0ffff) (i32.const 0xfffff0f0)) (i32.const 0xffffffff)) 156 (assert_return (invoke "or" (i32.const 0xffffffff) (i32.const 0xffffffff)) (i32.const 0xffffffff)) 157 158 (assert_return (invoke "xor" (i32.const 1) (i32.const 0)) (i32.const 1)) 159 (assert_return (invoke "xor" (i32.const 0) (i32.const 1)) (i32.const 1)) 160 (assert_return (invoke "xor" (i32.const 1) (i32.const 1)) (i32.const 0)) 161 (assert_return (invoke "xor" (i32.const 0) (i32.const 0)) (i32.const 0)) 162 (assert_return (invoke "xor" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const -1)) 163 (assert_return (invoke "xor" (i32.const 0x80000000) (i32.const 0)) (i32.const 0x80000000)) 164 (assert_return (invoke "xor" (i32.const -1) (i32.const 0x80000000)) (i32.const 0x7fffffff)) 165 (assert_return (invoke "xor" (i32.const -1) (i32.const 0x7fffffff)) (i32.const 0x80000000)) 166 (assert_return (invoke "xor" (i32.const 0xf0f0ffff) (i32.const 0xfffff0f0)) (i32.const 0x0f0f0f0f)) 167 (assert_return (invoke "xor" (i32.const 0xffffffff) (i32.const 0xffffffff)) (i32.const 0)) 168 169 (assert_return (invoke "shl" (i32.const 1) (i32.const 1)) (i32.const 2)) 170 (assert_return (invoke "shl" (i32.const 1) (i32.const 0)) (i32.const 1)) 171 (assert_return (invoke "shl" (i32.const 0x7fffffff) (i32.const 1)) (i32.const 0xfffffffe)) 172 (assert_return (invoke "shl" (i32.const 0xffffffff) (i32.const 1)) (i32.const 0xfffffffe)) 173 (assert_return (invoke "shl" (i32.const 0x80000000) (i32.const 1)) (i32.const 0)) 174 (assert_return (invoke "shl" (i32.const 0x40000000) (i32.const 1)) (i32.const 0x80000000)) 175 (assert_return (invoke "shl" (i32.const 1) (i32.const 31)) (i32.const 0x80000000)) 176 (assert_return (invoke "shl" (i32.const 1) (i32.const 32)) (i32.const 1)) 177 (assert_return (invoke "shl" (i32.const 1) (i32.const 33)) (i32.const 2)) 178 (assert_return (invoke "shl" (i32.const 1) (i32.const -1)) (i32.const 0x80000000)) 179 (assert_return (invoke "shl" (i32.const 1) (i32.const 0x7fffffff)) (i32.const 0x80000000)) 180 181 (assert_return (invoke "shr_s" (i32.const 1) (i32.const 1)) (i32.const 0)) 182 (assert_return (invoke "shr_s" (i32.const 1) (i32.const 0)) (i32.const 1)) 183 (assert_return (invoke "shr_s" (i32.const -1) (i32.const 1)) (i32.const -1)) 184 (assert_return (invoke "shr_s" (i32.const 0x7fffffff) (i32.const 1)) (i32.const 0x3fffffff)) 185 (assert_return (invoke "shr_s" (i32.const 0x80000000) (i32.const 1)) (i32.const 0xc0000000)) 186 (assert_return (invoke "shr_s" (i32.const 0x40000000) (i32.const 1)) (i32.const 0x20000000)) 187 (assert_return (invoke "shr_s" (i32.const 1) (i32.const 32)) (i32.const 1)) 188 (assert_return (invoke "shr_s" (i32.const 1) (i32.const 33)) (i32.const 0)) 189 (assert_return (invoke "shr_s" (i32.const 1) (i32.const -1)) (i32.const 0)) 190 (assert_return (invoke "shr_s" (i32.const 1) (i32.const 0x7fffffff)) (i32.const 0)) 191 (assert_return (invoke "shr_s" (i32.const 1) (i32.const 0x80000000)) (i32.const 1)) 192 (assert_return (invoke "shr_s" (i32.const 0x80000000) (i32.const 31)) (i32.const -1)) 193 (assert_return (invoke "shr_s" (i32.const -1) (i32.const 32)) (i32.const -1)) 194 (assert_return (invoke "shr_s" (i32.const -1) (i32.const 33)) (i32.const -1)) 195 (assert_return (invoke "shr_s" (i32.const -1) (i32.const -1)) (i32.const -1)) 196 (assert_return (invoke "shr_s" (i32.const -1) (i32.const 0x7fffffff)) (i32.const -1)) 197 (assert_return (invoke "shr_s" (i32.const -1) (i32.const 0x80000000)) (i32.const -1)) 198 199 (assert_return (invoke "shr_u" (i32.const 1) (i32.const 1)) (i32.const 0)) 200 (assert_return (invoke "shr_u" (i32.const 1) (i32.const 0)) (i32.const 1)) 201 (assert_return (invoke "shr_u" (i32.const -1) (i32.const 1)) (i32.const 0x7fffffff)) 202 (assert_return (invoke "shr_u" (i32.const 0x7fffffff) (i32.const 1)) (i32.const 0x3fffffff)) 203 (assert_return (invoke "shr_u" (i32.const 0x80000000) (i32.const 1)) (i32.const 0x40000000)) 204 (assert_return (invoke "shr_u" (i32.const 0x40000000) (i32.const 1)) (i32.const 0x20000000)) 205 (assert_return (invoke "shr_u" (i32.const 1) (i32.const 32)) (i32.const 1)) 206 (assert_return (invoke "shr_u" (i32.const 1) (i32.const 33)) (i32.const 0)) 207 (assert_return (invoke "shr_u" (i32.const 1) (i32.const -1)) (i32.const 0)) 208 (assert_return (invoke "shr_u" (i32.const 1) (i32.const 0x7fffffff)) (i32.const 0)) 209 (assert_return (invoke "shr_u" (i32.const 1) (i32.const 0x80000000)) (i32.const 1)) 210 (assert_return (invoke "shr_u" (i32.const 0x80000000) (i32.const 31)) (i32.const 1)) 211 (assert_return (invoke "shr_u" (i32.const -1) (i32.const 32)) (i32.const -1)) 212 (assert_return (invoke "shr_u" (i32.const -1) (i32.const 33)) (i32.const 0x7fffffff)) 213 (assert_return (invoke "shr_u" (i32.const -1) (i32.const -1)) (i32.const 1)) 214 (assert_return (invoke "shr_u" (i32.const -1) (i32.const 0x7fffffff)) (i32.const 1)) 215 (assert_return (invoke "shr_u" (i32.const -1) (i32.const 0x80000000)) (i32.const -1)) 216 217 (assert_return (invoke "rotl" (i32.const 1) (i32.const 1)) (i32.const 2)) 218 (assert_return (invoke "rotl" (i32.const 1) (i32.const 0)) (i32.const 1)) 219 (assert_return (invoke "rotl" (i32.const -1) (i32.const 1)) (i32.const -1)) 220 (assert_return (invoke "rotl" (i32.const 1) (i32.const 32)) (i32.const 1)) 221 (assert_return (invoke "rotl" (i32.const 0xabcd9876) (i32.const 1)) (i32.const 0x579b30ed)) 222 (assert_return (invoke "rotl" (i32.const 0xfe00dc00) (i32.const 4)) (i32.const 0xe00dc00f)) 223 (assert_return (invoke "rotl" (i32.const 0xb0c1d2e3) (i32.const 5)) (i32.const 0x183a5c76)) 224 (assert_return (invoke "rotl" (i32.const 0x00008000) (i32.const 37)) (i32.const 0x00100000)) 225 (assert_return (invoke "rotl" (i32.const 0xb0c1d2e3) (i32.const 0xff05)) (i32.const 0x183a5c76)) 226 (assert_return (invoke "rotl" (i32.const 0x769abcdf) (i32.const 0xffffffed)) (i32.const 0x579beed3)) 227 (assert_return (invoke "rotl" (i32.const 0x769abcdf) (i32.const 0x8000000d)) (i32.const 0x579beed3)) 228 (assert_return (invoke "rotl" (i32.const 1) (i32.const 31)) (i32.const 0x80000000)) 229 (assert_return (invoke "rotl" (i32.const 0x80000000) (i32.const 1)) (i32.const 1)) 230 231 (assert_return (invoke "rotr" (i32.const 1) (i32.const 1)) (i32.const 0x80000000)) 232 (assert_return (invoke "rotr" (i32.const 1) (i32.const 0)) (i32.const 1)) 233 (assert_return (invoke "rotr" (i32.const -1) (i32.const 1)) (i32.const -1)) 234 (assert_return (invoke "rotr" (i32.const 1) (i32.const 32)) (i32.const 1)) 235 (assert_return (invoke "rotr" (i32.const 0xff00cc00) (i32.const 1)) (i32.const 0x7f806600)) 236 (assert_return (invoke "rotr" (i32.const 0x00080000) (i32.const 4)) (i32.const 0x00008000)) 237 (assert_return (invoke "rotr" (i32.const 0xb0c1d2e3) (i32.const 5)) (i32.const 0x1d860e97)) 238 (assert_return (invoke "rotr" (i32.const 0x00008000) (i32.const 37)) (i32.const 0x00000400)) 239 (assert_return (invoke "rotr" (i32.const 0xb0c1d2e3) (i32.const 0xff05)) (i32.const 0x1d860e97)) 240 (assert_return (invoke "rotr" (i32.const 0x769abcdf) (i32.const 0xffffffed)) (i32.const 0xe6fbb4d5)) 241 (assert_return (invoke "rotr" (i32.const 0x769abcdf) (i32.const 0x8000000d)) (i32.const 0xe6fbb4d5)) 242 (assert_return (invoke "rotr" (i32.const 1) (i32.const 31)) (i32.const 2)) 243 (assert_return (invoke "rotr" (i32.const 0x80000000) (i32.const 31)) (i32.const 1)) 244 245 (assert_return (invoke "clz" (i32.const 0xffffffff)) (i32.const 0)) 246 (assert_return (invoke "clz" (i32.const 0)) (i32.const 32)) 247 (assert_return (invoke "clz" (i32.const 0x00008000)) (i32.const 16)) 248 (assert_return (invoke "clz" (i32.const 0xff)) (i32.const 24)) 249 (assert_return (invoke "clz" (i32.const 0x80000000)) (i32.const 0)) 250 (assert_return (invoke "clz" (i32.const 1)) (i32.const 31)) 251 (assert_return (invoke "clz" (i32.const 2)) (i32.const 30)) 252 (assert_return (invoke "clz" (i32.const 0x7fffffff)) (i32.const 1)) 253 254 (assert_return (invoke "ctz" (i32.const -1)) (i32.const 0)) 255 (assert_return (invoke "ctz" (i32.const 0)) (i32.const 32)) 256 (assert_return (invoke "ctz" (i32.const 0x00008000)) (i32.const 15)) 257 (assert_return (invoke "ctz" (i32.const 0x00010000)) (i32.const 16)) 258 (assert_return (invoke "ctz" (i32.const 0x80000000)) (i32.const 31)) 259 (assert_return (invoke "ctz" (i32.const 0x7fffffff)) (i32.const 0)) 260 261 (assert_return (invoke "popcnt" (i32.const -1)) (i32.const 32)) 262 (assert_return (invoke "popcnt" (i32.const 0)) (i32.const 0)) 263 (assert_return (invoke "popcnt" (i32.const 0x00008000)) (i32.const 1)) 264 (assert_return (invoke "popcnt" (i32.const 0x80008000)) (i32.const 2)) 265 (assert_return (invoke "popcnt" (i32.const 0x7fffffff)) (i32.const 31)) 266 (assert_return (invoke "popcnt" (i32.const 0xAAAAAAAA)) (i32.const 16)) 267 (assert_return (invoke "popcnt" (i32.const 0x55555555)) (i32.const 16)) 268 (assert_return (invoke "popcnt" (i32.const 0xDEADBEEF)) (i32.const 24)) 269 270 (assert_return (invoke "extend8_s" (i32.const 0)) (i32.const 0)) 271 (assert_return (invoke "extend8_s" (i32.const 0x7f)) (i32.const 127)) 272 (assert_return (invoke "extend8_s" (i32.const 0x80)) (i32.const -128)) 273 (assert_return (invoke "extend8_s" (i32.const 0xff)) (i32.const -1)) 274 (assert_return (invoke "extend8_s" (i32.const 0x012345_00)) (i32.const 0)) 275 (assert_return (invoke "extend8_s" (i32.const 0xfedcba_80)) (i32.const -0x80)) 276 (assert_return (invoke "extend8_s" (i32.const -1)) (i32.const -1)) 277 278 (assert_return (invoke "extend16_s" (i32.const 0)) (i32.const 0)) 279 (assert_return (invoke "extend16_s" (i32.const 0x7fff)) (i32.const 32767)) 280 (assert_return (invoke "extend16_s" (i32.const 0x8000)) (i32.const -32768)) 281 (assert_return (invoke "extend16_s" (i32.const 0xffff)) (i32.const -1)) 282 (assert_return (invoke "extend16_s" (i32.const 0x0123_0000)) (i32.const 0)) 283 (assert_return (invoke "extend16_s" (i32.const 0xfedc_8000)) (i32.const -0x8000)) 284 (assert_return (invoke "extend16_s" (i32.const -1)) (i32.const -1)) 285 286 (assert_return (invoke "eqz" (i32.const 0)) (i32.const 1)) 287 (assert_return (invoke "eqz" (i32.const 1)) (i32.const 0)) 288 (assert_return (invoke "eqz" (i32.const 0x80000000)) (i32.const 0)) 289 (assert_return (invoke "eqz" (i32.const 0x7fffffff)) (i32.const 0)) 290 (assert_return (invoke "eqz" (i32.const 0xffffffff)) (i32.const 0)) 291 292 (assert_return (invoke "eq" (i32.const 0) (i32.const 0)) (i32.const 1)) 293 (assert_return (invoke "eq" (i32.const 1) (i32.const 1)) (i32.const 1)) 294 (assert_return (invoke "eq" (i32.const -1) (i32.const 1)) (i32.const 0)) 295 (assert_return (invoke "eq" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 1)) 296 (assert_return (invoke "eq" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 1)) 297 (assert_return (invoke "eq" (i32.const -1) (i32.const -1)) (i32.const 1)) 298 (assert_return (invoke "eq" (i32.const 1) (i32.const 0)) (i32.const 0)) 299 (assert_return (invoke "eq" (i32.const 0) (i32.const 1)) (i32.const 0)) 300 (assert_return (invoke "eq" (i32.const 0x80000000) (i32.const 0)) (i32.const 0)) 301 (assert_return (invoke "eq" (i32.const 0) (i32.const 0x80000000)) (i32.const 0)) 302 (assert_return (invoke "eq" (i32.const 0x80000000) (i32.const -1)) (i32.const 0)) 303 (assert_return (invoke "eq" (i32.const -1) (i32.const 0x80000000)) (i32.const 0)) 304 (assert_return (invoke "eq" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 0)) 305 (assert_return (invoke "eq" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 0)) 306 307 (assert_return (invoke "ne" (i32.const 0) (i32.const 0)) (i32.const 0)) 308 (assert_return (invoke "ne" (i32.const 1) (i32.const 1)) (i32.const 0)) 309 (assert_return (invoke "ne" (i32.const -1) (i32.const 1)) (i32.const 1)) 310 (assert_return (invoke "ne" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0)) 311 (assert_return (invoke "ne" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 0)) 312 (assert_return (invoke "ne" (i32.const -1) (i32.const -1)) (i32.const 0)) 313 (assert_return (invoke "ne" (i32.const 1) (i32.const 0)) (i32.const 1)) 314 (assert_return (invoke "ne" (i32.const 0) (i32.const 1)) (i32.const 1)) 315 (assert_return (invoke "ne" (i32.const 0x80000000) (i32.const 0)) (i32.const 1)) 316 (assert_return (invoke "ne" (i32.const 0) (i32.const 0x80000000)) (i32.const 1)) 317 (assert_return (invoke "ne" (i32.const 0x80000000) (i32.const -1)) (i32.const 1)) 318 (assert_return (invoke "ne" (i32.const -1) (i32.const 0x80000000)) (i32.const 1)) 319 (assert_return (invoke "ne" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 1)) 320 (assert_return (invoke "ne" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 1)) 321 322 (assert_return (invoke "lt_s" (i32.const 0) (i32.const 0)) (i32.const 0)) 323 (assert_return (invoke "lt_s" (i32.const 1) (i32.const 1)) (i32.const 0)) 324 (assert_return (invoke "lt_s" (i32.const -1) (i32.const 1)) (i32.const 1)) 325 (assert_return (invoke "lt_s" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0)) 326 (assert_return (invoke "lt_s" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 0)) 327 (assert_return (invoke "lt_s" (i32.const -1) (i32.const -1)) (i32.const 0)) 328 (assert_return (invoke "lt_s" (i32.const 1) (i32.const 0)) (i32.const 0)) 329 (assert_return (invoke "lt_s" (i32.const 0) (i32.const 1)) (i32.const 1)) 330 (assert_return (invoke "lt_s" (i32.const 0x80000000) (i32.const 0)) (i32.const 1)) 331 (assert_return (invoke "lt_s" (i32.const 0) (i32.const 0x80000000)) (i32.const 0)) 332 (assert_return (invoke "lt_s" (i32.const 0x80000000) (i32.const -1)) (i32.const 1)) 333 (assert_return (invoke "lt_s" (i32.const -1) (i32.const 0x80000000)) (i32.const 0)) 334 (assert_return (invoke "lt_s" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 1)) 335 (assert_return (invoke "lt_s" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 0)) 336 337 (assert_return (invoke "lt_u" (i32.const 0) (i32.const 0)) (i32.const 0)) 338 (assert_return (invoke "lt_u" (i32.const 1) (i32.const 1)) (i32.const 0)) 339 (assert_return (invoke "lt_u" (i32.const -1) (i32.const 1)) (i32.const 0)) 340 (assert_return (invoke "lt_u" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0)) 341 (assert_return (invoke "lt_u" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 0)) 342 (assert_return (invoke "lt_u" (i32.const -1) (i32.const -1)) (i32.const 0)) 343 (assert_return (invoke "lt_u" (i32.const 1) (i32.const 0)) (i32.const 0)) 344 (assert_return (invoke "lt_u" (i32.const 0) (i32.const 1)) (i32.const 1)) 345 (assert_return (invoke "lt_u" (i32.const 0x80000000) (i32.const 0)) (i32.const 0)) 346 (assert_return (invoke "lt_u" (i32.const 0) (i32.const 0x80000000)) (i32.const 1)) 347 (assert_return (invoke "lt_u" (i32.const 0x80000000) (i32.const -1)) (i32.const 1)) 348 (assert_return (invoke "lt_u" (i32.const -1) (i32.const 0x80000000)) (i32.const 0)) 349 (assert_return (invoke "lt_u" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 0)) 350 (assert_return (invoke "lt_u" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 1)) 351 352 (assert_return (invoke "le_s" (i32.const 0) (i32.const 0)) (i32.const 1)) 353 (assert_return (invoke "le_s" (i32.const 1) (i32.const 1)) (i32.const 1)) 354 (assert_return (invoke "le_s" (i32.const -1) (i32.const 1)) (i32.const 1)) 355 (assert_return (invoke "le_s" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 1)) 356 (assert_return (invoke "le_s" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 1)) 357 (assert_return (invoke "le_s" (i32.const -1) (i32.const -1)) (i32.const 1)) 358 (assert_return (invoke "le_s" (i32.const 1) (i32.const 0)) (i32.const 0)) 359 (assert_return (invoke "le_s" (i32.const 0) (i32.const 1)) (i32.const 1)) 360 (assert_return (invoke "le_s" (i32.const 0x80000000) (i32.const 0)) (i32.const 1)) 361 (assert_return (invoke "le_s" (i32.const 0) (i32.const 0x80000000)) (i32.const 0)) 362 (assert_return (invoke "le_s" (i32.const 0x80000000) (i32.const -1)) (i32.const 1)) 363 (assert_return (invoke "le_s" (i32.const -1) (i32.const 0x80000000)) (i32.const 0)) 364 (assert_return (invoke "le_s" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 1)) 365 (assert_return (invoke "le_s" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 0)) 366 367 (assert_return (invoke "le_u" (i32.const 0) (i32.const 0)) (i32.const 1)) 368 (assert_return (invoke "le_u" (i32.const 1) (i32.const 1)) (i32.const 1)) 369 (assert_return (invoke "le_u" (i32.const -1) (i32.const 1)) (i32.const 0)) 370 (assert_return (invoke "le_u" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 1)) 371 (assert_return (invoke "le_u" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 1)) 372 (assert_return (invoke "le_u" (i32.const -1) (i32.const -1)) (i32.const 1)) 373 (assert_return (invoke "le_u" (i32.const 1) (i32.const 0)) (i32.const 0)) 374 (assert_return (invoke "le_u" (i32.const 0) (i32.const 1)) (i32.const 1)) 375 (assert_return (invoke "le_u" (i32.const 0x80000000) (i32.const 0)) (i32.const 0)) 376 (assert_return (invoke "le_u" (i32.const 0) (i32.const 0x80000000)) (i32.const 1)) 377 (assert_return (invoke "le_u" (i32.const 0x80000000) (i32.const -1)) (i32.const 1)) 378 (assert_return (invoke "le_u" (i32.const -1) (i32.const 0x80000000)) (i32.const 0)) 379 (assert_return (invoke "le_u" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 0)) 380 (assert_return (invoke "le_u" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 1)) 381 382 (assert_return (invoke "gt_s" (i32.const 0) (i32.const 0)) (i32.const 0)) 383 (assert_return (invoke "gt_s" (i32.const 1) (i32.const 1)) (i32.const 0)) 384 (assert_return (invoke "gt_s" (i32.const -1) (i32.const 1)) (i32.const 0)) 385 (assert_return (invoke "gt_s" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0)) 386 (assert_return (invoke "gt_s" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 0)) 387 (assert_return (invoke "gt_s" (i32.const -1) (i32.const -1)) (i32.const 0)) 388 (assert_return (invoke "gt_s" (i32.const 1) (i32.const 0)) (i32.const 1)) 389 (assert_return (invoke "gt_s" (i32.const 0) (i32.const 1)) (i32.const 0)) 390 (assert_return (invoke "gt_s" (i32.const 0x80000000) (i32.const 0)) (i32.const 0)) 391 (assert_return (invoke "gt_s" (i32.const 0) (i32.const 0x80000000)) (i32.const 1)) 392 (assert_return (invoke "gt_s" (i32.const 0x80000000) (i32.const -1)) (i32.const 0)) 393 (assert_return (invoke "gt_s" (i32.const -1) (i32.const 0x80000000)) (i32.const 1)) 394 (assert_return (invoke "gt_s" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 0)) 395 (assert_return (invoke "gt_s" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 1)) 396 397 (assert_return (invoke "gt_u" (i32.const 0) (i32.const 0)) (i32.const 0)) 398 (assert_return (invoke "gt_u" (i32.const 1) (i32.const 1)) (i32.const 0)) 399 (assert_return (invoke "gt_u" (i32.const -1) (i32.const 1)) (i32.const 1)) 400 (assert_return (invoke "gt_u" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0)) 401 (assert_return (invoke "gt_u" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 0)) 402 (assert_return (invoke "gt_u" (i32.const -1) (i32.const -1)) (i32.const 0)) 403 (assert_return (invoke "gt_u" (i32.const 1) (i32.const 0)) (i32.const 1)) 404 (assert_return (invoke "gt_u" (i32.const 0) (i32.const 1)) (i32.const 0)) 405 (assert_return (invoke "gt_u" (i32.const 0x80000000) (i32.const 0)) (i32.const 1)) 406 (assert_return (invoke "gt_u" (i32.const 0) (i32.const 0x80000000)) (i32.const 0)) 407 (assert_return (invoke "gt_u" (i32.const 0x80000000) (i32.const -1)) (i32.const 0)) 408 (assert_return (invoke "gt_u" (i32.const -1) (i32.const 0x80000000)) (i32.const 1)) 409 (assert_return (invoke "gt_u" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 1)) 410 (assert_return (invoke "gt_u" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 0)) 411 412 (assert_return (invoke "ge_s" (i32.const 0) (i32.const 0)) (i32.const 1)) 413 (assert_return (invoke "ge_s" (i32.const 1) (i32.const 1)) (i32.const 1)) 414 (assert_return (invoke "ge_s" (i32.const -1) (i32.const 1)) (i32.const 0)) 415 (assert_return (invoke "ge_s" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 1)) 416 (assert_return (invoke "ge_s" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 1)) 417 (assert_return (invoke "ge_s" (i32.const -1) (i32.const -1)) (i32.const 1)) 418 (assert_return (invoke "ge_s" (i32.const 1) (i32.const 0)) (i32.const 1)) 419 (assert_return (invoke "ge_s" (i32.const 0) (i32.const 1)) (i32.const 0)) 420 (assert_return (invoke "ge_s" (i32.const 0x80000000) (i32.const 0)) (i32.const 0)) 421 (assert_return (invoke "ge_s" (i32.const 0) (i32.const 0x80000000)) (i32.const 1)) 422 (assert_return (invoke "ge_s" (i32.const 0x80000000) (i32.const -1)) (i32.const 0)) 423 (assert_return (invoke "ge_s" (i32.const -1) (i32.const 0x80000000)) (i32.const 1)) 424 (assert_return (invoke "ge_s" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 0)) 425 (assert_return (invoke "ge_s" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 1)) 426 427 (assert_return (invoke "ge_u" (i32.const 0) (i32.const 0)) (i32.const 1)) 428 (assert_return (invoke "ge_u" (i32.const 1) (i32.const 1)) (i32.const 1)) 429 (assert_return (invoke "ge_u" (i32.const -1) (i32.const 1)) (i32.const 1)) 430 (assert_return (invoke "ge_u" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 1)) 431 (assert_return (invoke "ge_u" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 1)) 432 (assert_return (invoke "ge_u" (i32.const -1) (i32.const -1)) (i32.const 1)) 433 (assert_return (invoke "ge_u" (i32.const 1) (i32.const 0)) (i32.const 1)) 434 (assert_return (invoke "ge_u" (i32.const 0) (i32.const 1)) (i32.const 0)) 435 (assert_return (invoke "ge_u" (i32.const 0x80000000) (i32.const 0)) (i32.const 1)) 436 (assert_return (invoke "ge_u" (i32.const 0) (i32.const 0x80000000)) (i32.const 0)) 437 (assert_return (invoke "ge_u" (i32.const 0x80000000) (i32.const -1)) (i32.const 0)) 438 (assert_return (invoke "ge_u" (i32.const -1) (i32.const 0x80000000)) (i32.const 1)) 439 (assert_return (invoke "ge_u" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 1)) 440 (assert_return (invoke "ge_u" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 0)) 441 442 443 (assert_invalid 444 (module 445 (func $type-unary-operand-empty 446 (i32.eqz) (drop) 447 ) 448 ) 449 "type mismatch" 450 ) 451 (assert_invalid 452 (module 453 (func $type-unary-operand-empty-in-block 454 (i32.const 0) 455 (block (i32.eqz) (drop)) 456 ) 457 ) 458 "type mismatch" 459 ) 460 (assert_invalid 461 (module 462 (func $type-unary-operand-empty-in-loop 463 (i32.const 0) 464 (loop (i32.eqz) (drop)) 465 ) 466 ) 467 "type mismatch" 468 ) 469 (assert_invalid 470 (module 471 (func $type-unary-operand-empty-in-if 472 (i32.const 0) (i32.const 0) 473 (if (then (i32.eqz) (drop))) 474 ) 475 ) 476 "type mismatch" 477 ) 478 (assert_invalid 479 (module 480 (func $type-unary-operand-empty-in-else 481 (i32.const 0) (i32.const 0) 482 (if (result i32) (then (i32.const 0)) (else (i32.eqz))) (drop) 483 ) 484 ) 485 "type mismatch" 486 ) 487 (assert_invalid 488 (module 489 (func $type-unary-operand-empty-in-br 490 (i32.const 0) 491 (block (br 0 (i32.eqz)) (drop)) 492 ) 493 ) 494 "type mismatch" 495 ) 496 (assert_invalid 497 (module 498 (func $type-unary-operand-empty-in-br_if 499 (i32.const 0) 500 (block (br_if 0 (i32.eqz) (i32.const 1)) (drop)) 501 ) 502 ) 503 "type mismatch" 504 ) 505 (assert_invalid 506 (module 507 (func $type-unary-operand-empty-in-br_table 508 (i32.const 0) 509 (block (br_table 0 (i32.eqz)) (drop)) 510 ) 511 ) 512 "type mismatch" 513 ) 514 (assert_invalid 515 (module 516 (func $type-unary-operand-empty-in-return 517 (return (i32.eqz)) (drop) 518 ) 519 ) 520 "type mismatch" 521 ) 522 (assert_invalid 523 (module 524 (func $type-unary-operand-empty-in-select 525 (select (i32.eqz) (i32.const 1) (i32.const 2)) (drop) 526 ) 527 ) 528 "type mismatch" 529 ) 530 (assert_invalid 531 (module 532 (func $type-unary-operand-empty-in-call 533 (call 1 (i32.eqz)) (drop) 534 ) 535 (func (param i32) (result i32) (local.get 0)) 536 ) 537 "type mismatch" 538 ) 539 (assert_invalid 540 (module 541 (func $f (param i32) (result i32) (local.get 0)) 542 (type $sig (func (param i32) (result i32))) 543 (table funcref (elem $f)) 544 (func $type-unary-operand-empty-in-call_indirect 545 (block (result i32) 546 (call_indirect (type $sig) 547 (i32.eqz) (i32.const 0) 548 ) 549 (drop) 550 ) 551 ) 552 ) 553 "type mismatch" 554 ) 555 (assert_invalid 556 (module 557 (func $type-unary-operand-empty-in-local.set 558 (local i32) 559 (local.set 0 (i32.eqz)) (local.get 0) (drop) 560 ) 561 ) 562 "type mismatch" 563 ) 564 (assert_invalid 565 (module 566 (func $type-unary-operand-empty-in-local.tee 567 (local i32) 568 (local.tee 0 (i32.eqz)) (drop) 569 ) 570 ) 571 "type mismatch" 572 ) 573 (assert_invalid 574 (module 575 (global $x (mut i32) (i32.const 0)) 576 (func $type-unary-operand-empty-in-global.set 577 (global.set $x (i32.eqz)) (global.get $x) (drop) 578 ) 579 ) 580 "type mismatch" 581 ) 582 (assert_invalid 583 (module 584 (memory 0) 585 (func $type-unary-operand-empty-in-memory.grow 586 (memory.grow (i32.eqz)) (drop) 587 ) 588 ) 589 "type mismatch" 590 ) 591 (assert_invalid 592 (module 593 (memory 0) 594 (func $type-unary-operand-empty-in-load 595 (i32.load (i32.eqz)) (drop) 596 ) 597 ) 598 "type mismatch" 599 ) 600 (assert_invalid 601 (module 602 (memory 1) 603 (func $type-unary-operand-empty-in-store 604 (i32.store (i32.eqz) (i32.const 1)) 605 ) 606 ) 607 "type mismatch" 608 ) 609 610 (assert_invalid 611 (module 612 (func $type-binary-1st-operand-empty 613 (i32.add) (drop) 614 ) 615 ) 616 "type mismatch" 617 ) 618 (assert_invalid 619 (module 620 (func $type-binary-2nd-operand-empty 621 (i32.const 0) (i32.add) (drop) 622 ) 623 ) 624 "type mismatch" 625 ) 626 (assert_invalid 627 (module 628 (func $type-binary-1st-operand-empty-in-block 629 (i32.const 0) (i32.const 0) 630 (block (i32.add) (drop)) 631 ) 632 ) 633 "type mismatch" 634 ) 635 (assert_invalid 636 (module 637 (func $type-binary-2nd-operand-empty-in-block 638 (i32.const 0) 639 (block (i32.const 0) (i32.add) (drop)) 640 ) 641 ) 642 "type mismatch" 643 ) 644 (assert_invalid 645 (module 646 (func $type-binary-1st-operand-empty-in-loop 647 (i32.const 0) (i32.const 0) 648 (loop (i32.add) (drop)) 649 ) 650 ) 651 "type mismatch" 652 ) 653 (assert_invalid 654 (module 655 (func $type-binary-2nd-operand-empty-in-loop 656 (i32.const 0) 657 (loop (i32.const 0) (i32.add) (drop)) 658 ) 659 ) 660 "type mismatch" 661 ) 662 (assert_invalid 663 (module 664 (func $type-binary-1st-operand-empty-in-if 665 (i32.const 0) (i32.const 0) (i32.const 0) 666 (if (i32.add) (then (drop))) 667 ) 668 ) 669 "type mismatch" 670 ) 671 (assert_invalid 672 (module 673 (func $type-binary-2nd-operand-empty-in-if 674 (i32.const 0) (i32.const 0) 675 (if (i32.const 0) (then (i32.add)) (else (drop))) 676 ) 677 ) 678 "type mismatch" 679 ) 680 (assert_invalid 681 (module 682 (func $type-binary-1st-operand-empty-in-else 683 (i32.const 0) (i32.const 0) (i32.const 0) 684 (if (result i32) (then (i32.const 0)) (else (i32.add) (i32.const 0))) 685 (drop) (drop) 686 ) 687 ) 688 "type mismatch" 689 ) 690 (assert_invalid 691 (module 692 (func $type-binary-2nd-operand-empty-in-else 693 (i32.const 0) (i32.const 0) 694 (if (result i32) (then (i32.const 0)) (else (i32.add))) 695 (drop) 696 ) 697 ) 698 "type mismatch" 699 ) 700 (assert_invalid 701 (module 702 (func $type-binary-1st-operand-empty-in-br 703 (i32.const 0) (i32.const 0) 704 (block (br 0 (i32.add)) (drop)) 705 ) 706 ) 707 "type mismatch" 708 ) 709 (assert_invalid 710 (module 711 (func $type-binary-2nd-operand-empty-in-br 712 (i32.const 0) 713 (block (br 0 (i32.const 0) (i32.add)) (drop)) 714 ) 715 ) 716 "type mismatch" 717 ) 718 (assert_invalid 719 (module 720 (func $type-binary-1st-operand-empty-in-br_if 721 (i32.const 0) (i32.const 0) 722 (block (br_if 0 (i32.add) (i32.const 1)) (drop)) 723 ) 724 ) 725 "type mismatch" 726 ) 727 (assert_invalid 728 (module 729 (func $type-binary-2nd-operand-empty-in-br_if 730 (i32.const 0) 731 (block (br_if 0 (i32.const 0) (i32.add) (i32.const 1)) (drop)) 732 ) 733 ) 734 "type mismatch" 735 ) 736 (assert_invalid 737 (module 738 (func $type-binary-1st-operand-empty-in-br_table 739 (i32.const 0) (i32.const 0) 740 (block (br_table 0 (i32.add)) (drop)) 741 ) 742 ) 743 "type mismatch" 744 ) 745 (assert_invalid 746 (module 747 (func $type-binary-2nd-operand-empty-in-br_table 748 (i32.const 0) 749 (block (br_table 0 (i32.const 0) (i32.add)) (drop)) 750 ) 751 ) 752 "type mismatch" 753 ) 754 (assert_invalid 755 (module 756 (func $type-binary-1st-operand-empty-in-return 757 (return (i32.add)) (drop) 758 ) 759 ) 760 "type mismatch" 761 ) 762 (assert_invalid 763 (module 764 (func $type-binary-2nd-operand-empty-in-return 765 (return (i32.const 0) (i32.add)) (drop) 766 ) 767 ) 768 "type mismatch" 769 ) 770 (assert_invalid 771 (module 772 (func $type-binary-1st-operand-empty-in-select 773 (select (i32.add) (i32.const 1) (i32.const 2)) (drop) 774 ) 775 ) 776 "type mismatch" 777 ) 778 (assert_invalid 779 (module 780 (func $type-binary-2nd-operand-empty-in-select 781 (select (i32.const 0) (i32.add) (i32.const 1) (i32.const 2)) (drop) 782 ) 783 ) 784 "type mismatch" 785 ) 786 (assert_invalid 787 (module 788 (func $type-binary-1st-operand-empty-in-call 789 (call 1 (i32.add)) (drop) 790 ) 791 (func (param i32 i32) (result i32) (local.get 0)) 792 ) 793 "type mismatch" 794 ) 795 (assert_invalid 796 (module 797 (func $type-binary-2nd-operand-empty-in-call 798 (call 1 (i32.const 0) (i32.add)) (drop) 799 ) 800 (func (param i32 i32) (result i32) (local.get 0)) 801 ) 802 "type mismatch" 803 ) 804 (assert_invalid 805 (module 806 (func $f (param i32) (result i32) (local.get 0)) 807 (type $sig (func (param i32) (result i32))) 808 (table funcref (elem $f)) 809 (func $type-binary-1st-operand-empty-in-call_indirect 810 (block (result i32) 811 (call_indirect (type $sig) 812 (i32.add) (i32.const 0) 813 ) 814 (drop) 815 ) 816 ) 817 ) 818 "type mismatch" 819 ) 820 (assert_invalid 821 (module 822 (func $f (param i32) (result i32) (local.get 0)) 823 (type $sig (func (param i32) (result i32))) 824 (table funcref (elem $f)) 825 (func $type-binary-2nd-operand-empty-in-call_indirect 826 (block (result i32) 827 (call_indirect (type $sig) 828 (i32.const 0) (i32.add) (i32.const 0) 829 ) 830 (drop) 831 ) 832 ) 833 ) 834 "type mismatch" 835 ) 836 (assert_invalid 837 (module 838 (func $type-binary-1st-operand-empty-in-local.set 839 (local i32) 840 (local.set 0 (i32.add)) (local.get 0) (drop) 841 ) 842 ) 843 "type mismatch" 844 ) 845 (assert_invalid 846 (module 847 (func $type-binary-2nd-operand-empty-in-local.set 848 (local i32) 849 (local.set 0 (i32.const 0) (i32.add)) (local.get 0) (drop) 850 ) 851 ) 852 "type mismatch" 853 ) 854 (assert_invalid 855 (module 856 (func $type-binary-1st-operand-empty-in-local.tee 857 (local i32) 858 (local.tee 0 (i32.add)) (drop) 859 ) 860 ) 861 "type mismatch" 862 ) 863 (assert_invalid 864 (module 865 (func $type-binary-2nd-operand-empty-in-local.tee 866 (local i32) 867 (local.tee 0 (i32.const 0) (i32.add)) (drop) 868 ) 869 ) 870 "type mismatch" 871 ) 872 (assert_invalid 873 (module 874 (global $x (mut i32) (i32.const 0)) 875 (func $type-binary-1st-operand-empty-in-global.set 876 (global.set $x (i32.add)) (global.get $x) (drop) 877 ) 878 ) 879 "type mismatch" 880 ) 881 (assert_invalid 882 (module 883 (global $x (mut i32) (i32.const 0)) 884 (func $type-binary-2nd-operand-empty-in-global.set 885 (global.set $x (i32.const 0) (i32.add)) (global.get $x) (drop) 886 ) 887 ) 888 "type mismatch" 889 ) 890 (assert_invalid 891 (module 892 (memory 0) 893 (func $type-binary-1st-operand-empty-in-memory.grow 894 (memory.grow (i32.add)) (drop) 895 ) 896 ) 897 "type mismatch" 898 ) 899 (assert_invalid 900 (module 901 (memory 0) 902 (func $type-binary-2nd-operand-empty-in-memory.grow 903 (memory.grow (i32.const 0) (i32.add)) (drop) 904 ) 905 ) 906 "type mismatch" 907 ) 908 (assert_invalid 909 (module 910 (memory 0) 911 (func $type-binary-1st-operand-empty-in-load 912 (i32.load (i32.add)) (drop) 913 ) 914 ) 915 "type mismatch" 916 ) 917 (assert_invalid 918 (module 919 (memory 0) 920 (func $type-binary-2nd-operand-empty-in-load 921 (i32.load (i32.const 0) (i32.add)) (drop) 922 ) 923 ) 924 "type mismatch" 925 ) 926 (assert_invalid 927 (module 928 (memory 1) 929 (func $type-binary-1st-operand-empty-in-store 930 (i32.store (i32.add) (i32.const 1)) 931 ) 932 ) 933 "type mismatch" 934 ) 935 (assert_invalid 936 (module 937 (memory 1) 938 (func $type-binary-2nd-operand-empty-in-store 939 (i32.store (i32.const 1) (i32.add) (i32.const 0)) 940 ) 941 ) 942 "type mismatch" 943 ) 944 945 946 ;; Type check 947 948 (assert_invalid (module (func (result i32) (i32.add (i64.const 0) (f32.const 0)))) "type mismatch") 949 (assert_invalid (module (func (result i32) (i32.and (i64.const 0) (f32.const 0)))) "type mismatch") 950 (assert_invalid (module (func (result i32) (i32.div_s (i64.const 0) (f32.const 0)))) "type mismatch") 951 (assert_invalid (module (func (result i32) (i32.div_u (i64.const 0) (f32.const 0)))) "type mismatch") 952 (assert_invalid (module (func (result i32) (i32.mul (i64.const 0) (f32.const 0)))) "type mismatch") 953 (assert_invalid (module (func (result i32) (i32.or (i64.const 0) (f32.const 0)))) "type mismatch") 954 (assert_invalid (module (func (result i32) (i32.rem_s (i64.const 0) (f32.const 0)))) "type mismatch") 955 (assert_invalid (module (func (result i32) (i32.rem_u (i64.const 0) (f32.const 0)))) "type mismatch") 956 (assert_invalid (module (func (result i32) (i32.rotl (i64.const 0) (f32.const 0)))) "type mismatch") 957 (assert_invalid (module (func (result i32) (i32.rotr (i64.const 0) (f32.const 0)))) "type mismatch") 958 (assert_invalid (module (func (result i32) (i32.shl (i64.const 0) (f32.const 0)))) "type mismatch") 959 (assert_invalid (module (func (result i32) (i32.shr_s (i64.const 0) (f32.const 0)))) "type mismatch") 960 (assert_invalid (module (func (result i32) (i32.shr_u (i64.const 0) (f32.const 0)))) "type mismatch") 961 (assert_invalid (module (func (result i32) (i32.sub (i64.const 0) (f32.const 0)))) "type mismatch") 962 (assert_invalid (module (func (result i32) (i32.xor (i64.const 0) (f32.const 0)))) "type mismatch") 963 (assert_invalid (module (func (result i32) (i32.eqz (i64.const 0)))) "type mismatch") 964 (assert_invalid (module (func (result i32) (i32.clz (i64.const 0)))) "type mismatch") 965 (assert_invalid (module (func (result i32) (i32.ctz (i64.const 0)))) "type mismatch") 966 (assert_invalid (module (func (result i32) (i32.popcnt (i64.const 0)))) "type mismatch") 967 (assert_invalid (module (func (result i32) (i32.eq (i64.const 0) (f32.const 0)))) "type mismatch") 968 (assert_invalid (module (func (result i32) (i32.ge_s (i64.const 0) (f32.const 0)))) "type mismatch") 969 (assert_invalid (module (func (result i32) (i32.ge_u (i64.const 0) (f32.const 0)))) "type mismatch") 970 (assert_invalid (module (func (result i32) (i32.gt_s (i64.const 0) (f32.const 0)))) "type mismatch") 971 (assert_invalid (module (func (result i32) (i32.gt_u (i64.const 0) (f32.const 0)))) "type mismatch") 972 (assert_invalid (module (func (result i32) (i32.le_s (i64.const 0) (f32.const 0)))) "type mismatch") 973 (assert_invalid (module (func (result i32) (i32.le_u (i64.const 0) (f32.const 0)))) "type mismatch") 974 (assert_invalid (module (func (result i32) (i32.lt_s (i64.const 0) (f32.const 0)))) "type mismatch") 975 (assert_invalid (module (func (result i32) (i32.lt_u (i64.const 0) (f32.const 0)))) "type mismatch") 976 (assert_invalid (module (func (result i32) (i32.ne (i64.const 0) (f32.const 0)))) "type mismatch") 977 978 (assert_malformed 979 (module quote "(func (result i32) (i32.const nan:arithmetic))") 980 "unexpected token" 981 ) 982 (assert_malformed 983 (module quote "(func (result i32) (i32.const nan:canonical))") 984 "unexpected token" 985 )