|
| 1 | +;; at least one valid module is required for the testing framework |
| 2 | +(module) |
| 3 | + |
| 4 | +;; if condition |
| 5 | +(assert_invalid (module (func (if (f32.const 0) (nop) (nop)))) "type mismatch") |
| 6 | + |
| 7 | +;; br_if condition |
| 8 | +(assert_invalid (module (func (block (br_if 0 (f32.const 0))))) "type mismatch") |
| 9 | + |
| 10 | +;; br_table key |
| 11 | +(assert_invalid |
| 12 | + (module (func (block (br_table 0 (f32.const 0))))) |
| 13 | + "type mismatch") |
| 14 | + |
| 15 | +;; call params |
| 16 | +(assert_invalid (module (func (param i32)) (func (call 0 (f32.const 0)))) "type mismatch") |
| 17 | +(assert_invalid (module (import "a" "b" (param i32)) (func (call_import 0 (f32.const 0)))) "type mismatch") |
| 18 | +(assert_invalid |
| 19 | + (module |
| 20 | + (type (func (param i32))) |
| 21 | + (func (type 0)) |
| 22 | + (table 0) |
| 23 | + (func |
| 24 | + (call_indirect 0 (i32.const 0) (f32.const 0)))) |
| 25 | + "type mismatch") |
| 26 | + |
| 27 | +;; call_indirect index |
| 28 | +(assert_invalid |
| 29 | + (module |
| 30 | + (type (func)) |
| 31 | + (func (type 0)) |
| 32 | + (table 0) |
| 33 | + (func (call_indirect 0 (f32.const 0)))) |
| 34 | + "type mismatch") |
| 35 | + |
| 36 | +;; return |
| 37 | +(assert_invalid (module (func (result i32) (return (f32.const 0)))) "type mismatch") |
| 38 | + |
| 39 | +;; set_local |
| 40 | +(assert_invalid (module (func (local i32) (set_local 0 (f32.const 0)))) "type mismatch") |
| 41 | + |
| 42 | +;; load index |
| 43 | +(assert_invalid (module (memory 1) (func (i32.load (f32.const 0)))) "type mismatch") |
| 44 | +(assert_invalid (module (memory 1) (func (i32.load8_s (f32.const 0)))) "type mismatch") |
| 45 | +(assert_invalid (module (memory 1) (func (i32.load8_u (f32.const 0)))) "type mismatch") |
| 46 | +(assert_invalid (module (memory 1) (func (i32.load16_s (f32.const 0)))) "type mismatch") |
| 47 | +(assert_invalid (module (memory 1) (func (i32.load16_u (f32.const 0)))) "type mismatch") |
| 48 | +(assert_invalid (module (memory 1) (func (i64.load (f32.const 0)))) "type mismatch") |
| 49 | +(assert_invalid (module (memory 1) (func (i64.load8_s (f32.const 0)))) "type mismatch") |
| 50 | +(assert_invalid (module (memory 1) (func (i64.load8_u (f32.const 0)))) "type mismatch") |
| 51 | +(assert_invalid (module (memory 1) (func (i64.load16_s (f32.const 0)))) "type mismatch") |
| 52 | +(assert_invalid (module (memory 1) (func (i64.load16_u (f32.const 0)))) "type mismatch") |
| 53 | +(assert_invalid (module (memory 1) (func (i64.load32_s (f32.const 0)))) "type mismatch") |
| 54 | +(assert_invalid (module (memory 1) (func (i64.load32_u (f32.const 0)))) "type mismatch") |
| 55 | +(assert_invalid (module (memory 1) (func (f32.load (f32.const 0)))) "type mismatch") |
| 56 | +(assert_invalid (module (memory 1) (func (f64.load (f32.const 0)))) "type mismatch") |
| 57 | + |
| 58 | +;; store index |
| 59 | +(assert_invalid (module (memory 1) (func (i32.store (f32.const 0) (i32.const 0)))) "type mismatch") |
| 60 | +(assert_invalid (module (memory 1) (func (i32.store8 (f32.const 0) (i32.const 0)))) "type mismatch") |
| 61 | +(assert_invalid (module (memory 1) (func (i32.store16 (f32.const 0) (i32.const 0)))) "type mismatch") |
| 62 | +(assert_invalid (module (memory 1) (func (i64.store (f32.const 0) (i32.const 0)))) "type mismatch") |
| 63 | +(assert_invalid (module (memory 1) (func (i64.store8 (f32.const 0) (i64.const 0)))) "type mismatch") |
| 64 | +(assert_invalid (module (memory 1) (func (i64.store16 (f32.const 0) (i64.const 0)))) "type mismatch") |
| 65 | +(assert_invalid (module (memory 1) (func (i64.store32 (f32.const 0) (i64.const 0)))) "type mismatch") |
| 66 | +(assert_invalid (module (memory 1) (func (f32.store (f32.const 0) (f32.const 0)))) "type mismatch") |
| 67 | +(assert_invalid (module (memory 1) (func (f64.store (f32.const 0) (f64.const 0)))) "type mismatch") |
| 68 | + |
| 69 | +;; store value |
| 70 | +(assert_invalid (module (memory 1) (func (i32.store (i32.const 0) (f32.const 0)))) "type mismatch") |
| 71 | +(assert_invalid (module (memory 1) (func (i32.store8 (i32.const 0) (f32.const 0)))) "type mismatch") |
| 72 | +(assert_invalid (module (memory 1) (func (i32.store16 (i32.const 0) (f32.const 0)))) "type mismatch") |
| 73 | +(assert_invalid (module (memory 1) (func (i64.store (i32.const 0) (f32.const 0)))) "type mismatch") |
| 74 | +(assert_invalid (module (memory 1) (func (i64.store8 (i32.const 0) (f64.const 0)))) "type mismatch") |
| 75 | +(assert_invalid (module (memory 1) (func (i64.store16 (i32.const 0) (f64.const 0)))) "type mismatch") |
| 76 | +(assert_invalid (module (memory 1) (func (i64.store32 (i32.const 0) (f64.const 0)))) "type mismatch") |
| 77 | +(assert_invalid (module (memory 1) (func (f32.store (i32.const 0) (i32.const 0)))) "type mismatch") |
| 78 | +(assert_invalid (module (memory 1) (func (f64.store (i32.const 0) (i64.const 0)))) "type mismatch") |
| 79 | + |
| 80 | +;; binary |
| 81 | +(assert_invalid (module (func (i32.add (i64.const 0) (f32.const 0)))) "type mismatch") |
| 82 | +(assert_invalid (module (func (i32.and (i64.const 0) (f32.const 0)))) "type mismatch") |
| 83 | +(assert_invalid (module (func (i32.div_s (i64.const 0) (f32.const 0)))) "type mismatch") |
| 84 | +(assert_invalid (module (func (i32.div_u (i64.const 0) (f32.const 0)))) "type mismatch") |
| 85 | +(assert_invalid (module (func (i32.mul (i64.const 0) (f32.const 0)))) "type mismatch") |
| 86 | +(assert_invalid (module (func (i32.or (i64.const 0) (f32.const 0)))) "type mismatch") |
| 87 | +(assert_invalid (module (func (i32.rem_s (i64.const 0) (f32.const 0)))) "type mismatch") |
| 88 | +(assert_invalid (module (func (i32.rem_u (i64.const 0) (f32.const 0)))) "type mismatch") |
| 89 | +(assert_invalid (module (func (i32.rotl (i64.const 0) (f32.const 0)))) "type mismatch") |
| 90 | +(assert_invalid (module (func (i32.rotr (i64.const 0) (f32.const 0)))) "type mismatch") |
| 91 | +(assert_invalid (module (func (i32.shl (i64.const 0) (f32.const 0)))) "type mismatch") |
| 92 | +(assert_invalid (module (func (i32.shr_s (i64.const 0) (f32.const 0)))) "type mismatch") |
| 93 | +(assert_invalid (module (func (i32.shr_u (i64.const 0) (f32.const 0)))) "type mismatch") |
| 94 | +(assert_invalid (module (func (i32.sub (i64.const 0) (f32.const 0)))) "type mismatch") |
| 95 | +(assert_invalid (module (func (i32.xor (i64.const 0) (f32.const 0)))) "type mismatch") |
| 96 | +(assert_invalid (module (func (i64.add (i32.const 0) (f32.const 0)))) "type mismatch") |
| 97 | +(assert_invalid (module (func (i64.and (i32.const 0) (f32.const 0)))) "type mismatch") |
| 98 | +(assert_invalid (module (func (i64.div_s (i32.const 0) (f32.const 0)))) "type mismatch") |
| 99 | +(assert_invalid (module (func (i64.div_u (i32.const 0) (f32.const 0)))) "type mismatch") |
| 100 | +(assert_invalid (module (func (i64.mul (i32.const 0) (f32.const 0)))) "type mismatch") |
| 101 | +(assert_invalid (module (func (i64.or (i32.const 0) (f32.const 0)))) "type mismatch") |
| 102 | +(assert_invalid (module (func (i64.rem_s (i32.const 0) (f32.const 0)))) "type mismatch") |
| 103 | +(assert_invalid (module (func (i64.rem_u (i32.const 0) (f32.const 0)))) "type mismatch") |
| 104 | +(assert_invalid (module (func (i64.rotl (i32.const 0) (f32.const 0)))) "type mismatch") |
| 105 | +(assert_invalid (module (func (i64.rotr (i32.const 0) (f32.const 0)))) "type mismatch") |
| 106 | +(assert_invalid (module (func (i64.shl (i32.const 0) (f32.const 0)))) "type mismatch") |
| 107 | +(assert_invalid (module (func (i64.shr_s (i32.const 0) (f32.const 0)))) "type mismatch") |
| 108 | +(assert_invalid (module (func (i64.shr_u (i32.const 0) (f32.const 0)))) "type mismatch") |
| 109 | +(assert_invalid (module (func (i64.sub (i32.const 0) (f32.const 0)))) "type mismatch") |
| 110 | +(assert_invalid (module (func (i64.xor (i32.const 0) (f32.const 0)))) "type mismatch") |
| 111 | +(assert_invalid (module (func (f32.add (i64.const 0) (f64.const 0)))) "type mismatch") |
| 112 | +(assert_invalid (module (func (f32.copysign (i64.const 0) (f64.const 0)))) "type mismatch") |
| 113 | +(assert_invalid (module (func (f32.div (i64.const 0) (f64.const 0)))) "type mismatch") |
| 114 | +(assert_invalid (module (func (f32.max (i64.const 0) (f64.const 0)))) "type mismatch") |
| 115 | +(assert_invalid (module (func (f32.min (i64.const 0) (f64.const 0)))) "type mismatch") |
| 116 | +(assert_invalid (module (func (f32.mul (i64.const 0) (f64.const 0)))) "type mismatch") |
| 117 | +(assert_invalid (module (func (f32.sub (i64.const 0) (f64.const 0)))) "type mismatch") |
| 118 | +(assert_invalid (module (func (f64.add (i64.const 0) (f32.const 0)))) "type mismatch") |
| 119 | +(assert_invalid (module (func (f64.copysign (i64.const 0) (f32.const 0)))) "type mismatch") |
| 120 | +(assert_invalid (module (func (f64.div (i64.const 0) (f32.const 0)))) "type mismatch") |
| 121 | +(assert_invalid (module (func (f64.max (i64.const 0) (f32.const 0)))) "type mismatch") |
| 122 | +(assert_invalid (module (func (f64.min (i64.const 0) (f32.const 0)))) "type mismatch") |
| 123 | +(assert_invalid (module (func (f64.mul (i64.const 0) (f32.const 0)))) "type mismatch") |
| 124 | +(assert_invalid (module (func (f64.sub (i64.const 0) (f32.const 0)))) "type mismatch") |
| 125 | + |
| 126 | +;; unary |
| 127 | +(assert_invalid (module (func (i32.eqz (i64.const 0)))) "type mismatch") |
| 128 | +(assert_invalid (module (func (i32.clz (i64.const 0)))) "type mismatch") |
| 129 | +(assert_invalid (module (func (i32.ctz (i64.const 0)))) "type mismatch") |
| 130 | +(assert_invalid (module (func (i32.popcnt (i64.const 0)))) "type mismatch") |
| 131 | +(assert_invalid (module (func (i64.eqz (i32.const 0)))) "type mismatch") |
| 132 | +(assert_invalid (module (func (i64.clz (i32.const 0)))) "type mismatch") |
| 133 | +(assert_invalid (module (func (i64.ctz (i32.const 0)))) "type mismatch") |
| 134 | +(assert_invalid (module (func (i64.popcnt (i32.const 0)))) "type mismatch") |
| 135 | +(assert_invalid (module (func (f32.abs (i64.const 0)))) "type mismatch") |
| 136 | +(assert_invalid (module (func (f32.ceil (i64.const 0)))) "type mismatch") |
| 137 | +(assert_invalid (module (func (f32.floor (i64.const 0)))) "type mismatch") |
| 138 | +(assert_invalid (module (func (f32.nearest (i64.const 0)))) "type mismatch") |
| 139 | +(assert_invalid (module (func (f32.neg (i64.const 0)))) "type mismatch") |
| 140 | +(assert_invalid (module (func (f32.sqrt (i64.const 0)))) "type mismatch") |
| 141 | +(assert_invalid (module (func (f32.trunc (i64.const 0)))) "type mismatch") |
| 142 | +(assert_invalid (module (func (f64.abs (i64.const 0)))) "type mismatch") |
| 143 | +(assert_invalid (module (func (f64.ceil (i64.const 0)))) "type mismatch") |
| 144 | +(assert_invalid (module (func (f64.floor (i64.const 0)))) "type mismatch") |
| 145 | +(assert_invalid (module (func (f64.nearest (i64.const 0)))) "type mismatch") |
| 146 | +(assert_invalid (module (func (f64.neg (i64.const 0)))) "type mismatch") |
| 147 | +(assert_invalid (module (func (f64.sqrt (i64.const 0)))) "type mismatch") |
| 148 | +(assert_invalid (module (func (f64.trunc (i64.const 0)))) "type mismatch") |
| 149 | + |
| 150 | +;; compare |
| 151 | +(assert_invalid (module (func (i32.eq (i64.const 0) (f32.const 0)))) "type mismatch") |
| 152 | +(assert_invalid (module (func (i32.ge_s (i64.const 0) (f32.const 0)))) "type mismatch") |
| 153 | +(assert_invalid (module (func (i32.ge_u (i64.const 0) (f32.const 0)))) "type mismatch") |
| 154 | +(assert_invalid (module (func (i32.gt_s (i64.const 0) (f32.const 0)))) "type mismatch") |
| 155 | +(assert_invalid (module (func (i32.gt_u (i64.const 0) (f32.const 0)))) "type mismatch") |
| 156 | +(assert_invalid (module (func (i32.le_s (i64.const 0) (f32.const 0)))) "type mismatch") |
| 157 | +(assert_invalid (module (func (i32.le_u (i64.const 0) (f32.const 0)))) "type mismatch") |
| 158 | +(assert_invalid (module (func (i32.lt_s (i64.const 0) (f32.const 0)))) "type mismatch") |
| 159 | +(assert_invalid (module (func (i32.lt_u (i64.const 0) (f32.const 0)))) "type mismatch") |
| 160 | +(assert_invalid (module (func (i32.ne (i64.const 0) (f32.const 0)))) "type mismatch") |
| 161 | +(assert_invalid (module (func (i64.eq (i32.const 0) (f32.const 0)))) "type mismatch") |
| 162 | +(assert_invalid (module (func (i64.ge_s (i32.const 0) (f32.const 0)))) "type mismatch") |
| 163 | +(assert_invalid (module (func (i64.ge_u (i32.const 0) (f32.const 0)))) "type mismatch") |
| 164 | +(assert_invalid (module (func (i64.gt_s (i32.const 0) (f32.const 0)))) "type mismatch") |
| 165 | +(assert_invalid (module (func (i64.gt_u (i32.const 0) (f32.const 0)))) "type mismatch") |
| 166 | +(assert_invalid (module (func (i64.le_s (i32.const 0) (f32.const 0)))) "type mismatch") |
| 167 | +(assert_invalid (module (func (i64.le_u (i32.const 0) (f32.const 0)))) "type mismatch") |
| 168 | +(assert_invalid (module (func (i64.lt_s (i32.const 0) (f32.const 0)))) "type mismatch") |
| 169 | +(assert_invalid (module (func (i64.lt_u (i32.const 0) (f32.const 0)))) "type mismatch") |
| 170 | +(assert_invalid (module (func (i64.ne (i32.const 0) (f32.const 0)))) "type mismatch") |
| 171 | +(assert_invalid (module (func (f32.eq (i64.const 0) (f64.const 0)))) "type mismatch") |
| 172 | +(assert_invalid (module (func (f32.ge (i64.const 0) (f64.const 0)))) "type mismatch") |
| 173 | +(assert_invalid (module (func (f32.gt (i64.const 0) (f64.const 0)))) "type mismatch") |
| 174 | +(assert_invalid (module (func (f32.le (i64.const 0) (f64.const 0)))) "type mismatch") |
| 175 | +(assert_invalid (module (func (f32.lt (i64.const 0) (f64.const 0)))) "type mismatch") |
| 176 | +(assert_invalid (module (func (f32.ne (i64.const 0) (f64.const 0)))) "type mismatch") |
| 177 | +(assert_invalid (module (func (f64.eq (i64.const 0) (f32.const 0)))) "type mismatch") |
| 178 | +(assert_invalid (module (func (f64.ge (i64.const 0) (f32.const 0)))) "type mismatch") |
| 179 | +(assert_invalid (module (func (f64.gt (i64.const 0) (f32.const 0)))) "type mismatch") |
| 180 | +(assert_invalid (module (func (f64.le (i64.const 0) (f32.const 0)))) "type mismatch") |
| 181 | +(assert_invalid (module (func (f64.lt (i64.const 0) (f32.const 0)))) "type mismatch") |
| 182 | +(assert_invalid (module (func (f64.ne (i64.const 0) (f32.const 0)))) "type mismatch") |
| 183 | + |
| 184 | +;; convert |
| 185 | +(assert_invalid (module (func (i32.wrap/i64 (f32.const 0)))) "type mismatch") |
| 186 | +(assert_invalid (module (func (i32.trunc_s/f32 (i64.const 0)))) "type mismatch") |
| 187 | +(assert_invalid (module (func (i32.trunc_u/f32 (i64.const 0)))) "type mismatch") |
| 188 | +(assert_invalid (module (func (i32.trunc_s/f64 (i64.const 0)))) "type mismatch") |
| 189 | +(assert_invalid (module (func (i32.trunc_u/f64 (i64.const 0)))) "type mismatch") |
| 190 | +(assert_invalid (module (func (i32.reinterpret/f32 (i64.const 0)))) "type mismatch") |
| 191 | +(assert_invalid (module (func (i64.extend_s/i32 (f32.const 0)))) "type mismatch") |
| 192 | +(assert_invalid (module (func (i64.extend_u/i32 (f32.const 0)))) "type mismatch") |
| 193 | +(assert_invalid (module (func (i64.trunc_s/f32 (i32.const 0)))) "type mismatch") |
| 194 | +(assert_invalid (module (func (i64.trunc_u/f32 (i32.const 0)))) "type mismatch") |
| 195 | +(assert_invalid (module (func (i64.trunc_s/f64 (i32.const 0)))) "type mismatch") |
| 196 | +(assert_invalid (module (func (i64.trunc_u/f64 (i32.const 0)))) "type mismatch") |
| 197 | +(assert_invalid (module (func (i64.reinterpret/f64 (i32.const 0)))) "type mismatch") |
| 198 | +(assert_invalid (module (func (f32.convert_s/i32 (i64.const 0)))) "type mismatch") |
| 199 | +(assert_invalid (module (func (f32.convert_u/i32 (i64.const 0)))) "type mismatch") |
| 200 | +(assert_invalid (module (func (f32.convert_s/i64 (i32.const 0)))) "type mismatch") |
| 201 | +(assert_invalid (module (func (f32.convert_u/i64 (i32.const 0)))) "type mismatch") |
| 202 | +(assert_invalid (module (func (f32.demote/f64 (i32.const 0)))) "type mismatch") |
| 203 | +(assert_invalid (module (func (f32.reinterpret/i32 (i64.const 0)))) "type mismatch") |
| 204 | +(assert_invalid (module (func (f64.convert_s/i32 (i64.const 0)))) "type mismatch") |
| 205 | +(assert_invalid (module (func (f64.convert_u/i32 (i64.const 0)))) "type mismatch") |
| 206 | +(assert_invalid (module (func (f64.convert_s/i64 (i32.const 0)))) "type mismatch") |
| 207 | +(assert_invalid (module (func (f64.convert_u/i64 (i32.const 0)))) "type mismatch") |
| 208 | +(assert_invalid (module (func (f64.promote/f32 (i32.const 0)))) "type mismatch") |
| 209 | +(assert_invalid (module (func (f64.reinterpret/i64 (i32.const 0)))) "type mismatch") |
| 210 | + |
| 211 | +;; grow_memory |
| 212 | +(assert_invalid (module (memory 1) (func (grow_memory (f32.const 0)))) "type mismatch") |
0 commit comments