tests/cli/stack-switching/cont_resume.wast
raw| 1 | ;; RUN: wast --assert default --snapshot tests/snapshots % -f stack-switching |
| 2 | |
| 3 | (module |
| 4 | (type $ft (func)) |
| 5 | (type $ct (cont $ft)) |
| 6 | |
| 7 | (global $i (mut i32) (i32.const 0)) |
| 8 | |
| 9 | (func $g |
| 10 | (global.set $i (i32.const 42))) |
| 11 | (elem declare func $g) |
| 12 | |
| 13 | (func $f (export "f") (result i32) |
| 14 | (global.set $i (i32.const 99)) |
| 15 | (resume $ct (cont.new $ct (ref.func $g))) |
| 16 | (global.get $i)) |
| 17 | ) |
| 18 | |
| 19 | ;; (assert_return (invoke "f") (i32.const 42)) |