Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
linxuanm committed Oct 28, 2024
1 parent 0311e17 commit 1c036e1
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/regress/ext:stack-switching/suspend18.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
(module
(type $f (func))
(type $c (cont $f))
(tag $t)

(func $foo (suspend $t))
(elem declare func $foo)

(func (export "main") (result i32)
(i32.const 1)
(block (result (ref null $c))
(i32.const 2)
(i32.const 3)
(i32.const 4)
(i32.const 5)
(resume $c (on $t 0) (cont.new $c (ref.func $foo)))
(drop)
(drop)
(drop)
(drop)
(ref.null $c)
)
(drop)
(return)
)
)

(assert_return (invoke "main") (i32.const 1))
30 changes: 30 additions & 0 deletions test/regress/ext:stack-switching/suspend19.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
(module
(type $f (func))
(type $c (cont $f))
(tag $t)

(func $foo (suspend $t))
(elem declare func $foo)

(func (export "main") (result i32)
(local $x (ref null $c))
(i32.const 1)
(cont.new $c (ref.func $foo))
(loop (param (ref null $c))
(local.set $x)
(i32.const 2)
(i32.const 3)
(i32.const 4)
(i32.const 5)
(local.get $x)
(resume $c (on $t 0))
(drop)
(drop)
(drop)
(drop)
)
(return)
)
)

(assert_return (invoke "main") (i32.const 1))

0 comments on commit 1c036e1

Please sign in to comment.