|
154 | 154 | (assert_return (invoke "simple-throw-catch" (i32.const 0)) (i32.const 23))
|
155 | 155 | (assert_return (invoke "simple-throw-catch" (i32.const 1)) (i32.const 42))
|
156 | 156 |
|
157 |
| -(assert_exception (invoke "unreachable-not-caught")) |
| 157 | +(assert_trap (invoke "unreachable-not-caught") "unreachable") |
158 | 158 |
|
159 | 159 | (assert_return (invoke "trap-in-callee" (i32.const 7) (i32.const 2)) (i32.const 3))
|
160 |
| -(assert_exception (invoke "trap-in-callee" (i32.const 1) (i32.const 0))) |
| 160 | +(assert_trap (invoke "trap-in-callee" (i32.const 1) (i32.const 0)) "integer divide by zero") |
161 | 161 |
|
162 | 162 | (assert_return (invoke "catch-complex-1" (i32.const 0)) (i32.const 3))
|
163 | 163 | (assert_return (invoke "catch-complex-1" (i32.const 1)) (i32.const 4))
|
|
188 | 188 | (assert_return (invoke "catchless-try" (i32.const 0)) (i32.const 0))
|
189 | 189 | (assert_return (invoke "catchless-try" (i32.const 1)) (i32.const 1))
|
190 | 190 |
|
| 191 | +(module |
| 192 | + (func $imported-throw (import "test" "throw")) |
| 193 | + (tag $e0) |
| 194 | + |
| 195 | + (func (export "imported-mismatch") (result i32) |
| 196 | + (try (result i32) |
| 197 | + (do |
| 198 | + (try (result i32) |
| 199 | + (do |
| 200 | + (i32.const 1) |
| 201 | + (call $imported-throw) |
| 202 | + ) |
| 203 | + (catch $e0 (i32.const 2)) |
| 204 | + ) |
| 205 | + ) |
| 206 | + (catch_all (i32.const 3)) |
| 207 | + ) |
| 208 | + ) |
| 209 | +) |
| 210 | + |
| 211 | +(assert_return (invoke "imported-mismatch") (i32.const 3)) |
| 212 | + |
191 | 213 | (assert_malformed
|
192 | 214 | (module quote "(module (func (catch_all)))")
|
193 | 215 | "unexpected token"
|
|
204 | 226 | )
|
205 | 227 | "unexpected token"
|
206 | 228 | )
|
| 229 | + |
| 230 | +(assert_invalid (module (func (result i32) (try (result i32) (do)))) |
| 231 | + "type mismatch: instruction requires [i32] but stack has []") |
| 232 | +(assert_invalid (module (func (result i32) (try (result i32) (do (i64.const 42))))) |
| 233 | + "type mismatch: instruction requires [i32] but stack has [i64]") |
| 234 | +(assert_invalid (module (tag) (func (try (do) (catch 0 (i32.const 42))))) |
| 235 | + "type mismatch: block requires [] but stack has [i32]") |
| 236 | +(assert_invalid (module |
| 237 | + (tag (param i64)) |
| 238 | + (func (result i32) |
| 239 | + (try (result i32) (do (i32.const 42)) (catch 0)))) |
| 240 | + "type mismatch: instruction requires [i32] but stack has [i64]") |
| 241 | +(assert_invalid (module (func (try (do) (catch_all (i32.const 42))))) |
| 242 | + "type mismatch: block requires [] but stack has [i32]") |
0 commit comments