;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.
;; RUN: wasm-opt -all --dce %s -S -o - | filecheck %s

(module
 ;; CHECK:      (type $function (func))
 (type $function (func))
 ;; CHECK:      (type $cont (cont $function))
 (type $cont (cont $function))
 ;; CHECK:      (tag $tag (type $function))
 (tag $tag)

 ;; CHECK:      (func $resume (type $2) (param $c (ref $cont))
 ;; CHECK-NEXT:  (block $exit
 ;; CHECK-NEXT:   (drop
 ;; CHECK-NEXT:    (block $handle_effect (result (ref $cont))
 ;; CHECK-NEXT:     (resume $cont (on $tag $handle_effect)
 ;; CHECK-NEXT:      (local.get $c)
 ;; CHECK-NEXT:     )
 ;; CHECK-NEXT:     (br $exit)
 ;; CHECK-NEXT:    )
 ;; CHECK-NEXT:   )
 ;; CHECK-NEXT:  )
 ;; CHECK-NEXT: )
 (func $resume (param $c (ref $cont))
  (block $exit
  (drop
    ;; The return type of the block should not be dropped since we can
    ;; jump there when handling $tag.
    (block $handle_effect (result (ref $cont))
     (resume $cont (on $tag $handle_effect)
      (local.get $c)
     )
     (br $exit)
    )
   )
  )
 )

 ;; CHECK:      (func $resume_throw (type $2) (param $c (ref $cont))
 ;; CHECK-NEXT:  (block $exit
 ;; CHECK-NEXT:   (drop
 ;; CHECK-NEXT:    (block $handle_effect (result (ref $cont))
 ;; CHECK-NEXT:     (resume_throw $cont $tag (on $tag $handle_effect)
 ;; CHECK-NEXT:      (local.get $c)
 ;; CHECK-NEXT:     )
 ;; CHECK-NEXT:     (br $exit)
 ;; CHECK-NEXT:    )
 ;; CHECK-NEXT:   )
 ;; CHECK-NEXT:  )
 ;; CHECK-NEXT: )
 (func $resume_throw (param $c (ref $cont))
  (block $exit
   (drop
    ;; The return type of the block should not be dropped since we can
    ;; jump there when handling $tag.
    (block $handle_effect (result (ref $cont))
     (resume_throw $cont $tag (on $tag $handle_effect)
      (local.get $c)
     )
     (br $exit)
    )
   )
  )
 )
)
