diff --git a/test/core/stack-switching/cont.wast b/test/core/stack-switching/cont.wast index 29c48488..71a5b707 100644 --- a/test/core/stack-switching/cont.wast +++ b/test/core/stack-switching/cont.wast @@ -227,6 +227,33 @@ (type $c2 (cont $f2)) ) +;; Test resume_throw used on the very first execution of a continuation (so the +;; code in the continuation function is never reached). +(module + (tag $exn) + + (type $f (func)) + (type $k (cont $f)) + + (func $never + (unreachable) + ) + + (func (export "resume_throw-never") + (block $handle + (try_table (catch $exn $handle) + (resume_throw $k $exn + (cont.new $k (ref.func $never)) + ) + ) + ) + ) + + (elem declare func $never) +) + +(assert_return (invoke "resume_throw-never")) + ;; Simple state example (module $state