Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions test/async/during-sync-call-no-sibling-resume.wast
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,24 @@
;; immediately rather than resume it.
(component
(component $Inner
(import "sibling" (instance $sibling
(export "arm" (func))
))
(core module $Core
(import "" "thread.suspend" (func $thread.suspend (result i32)))
(import "" "arm" (func $arm))

;; non-async-typed: suspend with no thread of this instance to switch to
(func (export "sync-block")
(call $arm)
(drop (call $thread.suspend))
unreachable)
)
(canon thread.suspend (core func $thread.suspend))
(canon lower (func $sibling "arm") (core func $arm))
(core instance $core (instantiate $Core (with "" (instance
(export "thread.suspend" (func $thread.suspend))
(export "arm" (func $arm))
))))
(func (export "sync-block")
(canon lift (core func $core "sync-block")))
Expand Down Expand Up @@ -206,10 +213,9 @@
(func (export "arm")
(canon lift (core func $core "arm")))
)
(instance $inner (instantiate $Inner))
(instance $sibling (instantiate $Sibling))
(func (export "arm") (alias export $sibling "arm"))
(instance $inner (instantiate $Inner
(with "sibling" (instance $sibling))))
(func (export "sync-block") (alias export $inner "sync-block"))
)
(assert_return (invoke "arm"))
(assert_trap (invoke "sync-block") "cannot block a synchronous task before returning")
Loading