| 1 |
;; RUN: wast --assert default --snapshot tests/snapshots % -f=-cm-error-context |
| 2 |
|
| 3 |
;; error-context.new |
| 4 |
(assert_invalid |
| 5 |
(component |
| 6 |
(core module $libc (memory (export "memory") 1)) |
| 7 |
(core instance $libc (instantiate $libc)) |
| 8 |
(core module $m |
| 9 |
(import "" "error-context.new" (func $error-context-new (param i32 i32) (result i32))) |
| 10 |
) |
| 11 |
(core func $error-context-new (canon error-context.new (memory $libc "memory"))) |
| 12 |
(core instance $i (instantiate $m (with "" (instance (export "error-context.new" (func $error-context-new)))))) |
| 13 |
) |
| 14 |
"`error-context.new` requires the component model error-context feature" |
| 15 |
) |
| 16 |
|
| 17 |
;; error-context.debug-message |
| 18 |
(assert_invalid |
| 19 |
(component |
| 20 |
(core module $libc |
| 21 |
(func (export "realloc") (param i32 i32 i32 i32) (result i32) unreachable) |
| 22 |
(memory (export "memory") 1) |
| 23 |
) |
| 24 |
(core instance $libc (instantiate $libc)) |
| 25 |
(core module $m |
| 26 |
(import "" "error-context.debug-message" (func $error-context-debug-message (param i32 i32))) |
| 27 |
) |
| 28 |
(core func $error-context-debug-message (canon error-context.debug-message (memory $libc "memory") (realloc (func $libc "realloc")))) |
| 29 |
(core instance $i (instantiate $m (with "" (instance (export "error-context.debug-message" (func $error-context-debug-message)))))) |
| 30 |
) |
| 31 |
"`error-context.debug-message` requires the component model error-context feature" |
| 32 |
) |
| 33 |
|
| 34 |
;; error-context.drop |
| 35 |
(assert_invalid |
| 36 |
(component |
| 37 |
(core module $m |
| 38 |
(import "" "error-context.drop" (func $error-context-drop (param i32))) |
| 39 |
) |
| 40 |
(core func $error-context-drop (canon error-context.drop)) |
| 41 |
(core instance $i (instantiate $m (with "" (instance (export "error-context.drop" (func $error-context-drop)))))) |
| 42 |
) |
| 43 |
"`error-context.drop` requires the component model error-context feature" |
| 44 |
) |
| 45 |
|
| 46 |
;; various types |
| 47 |
(assert_invalid |
| 48 |
(component (type error-context)) |
| 49 |
"requires the component model error-context feature" |
| 50 |
) |