;;; TOOL: run-roundtrip
;;; ARGS: --stdout --fold-exprs --generate-names --enable-function-references --enable-exceptions

;; This test was failed because the "local is set" bitvector
;; was not cleared in BeginFunctionBody, and the bitvector
;; save/restore operations was missing for try tables

(module
  (tag $e0)

  (func (local (ref func) (ref func) (ref func)))
  (func
    (local (ref func) (ref func))
    try_table
    end)
  (func
    (local (ref func))
    try_table (catch $e0 0) (catch_all 0)
    end)
  (func
    unreachable
    try_table
    end))

(;; STDOUT ;;;
(module
  (type $t0 (func))
  (func $f0 (type $t0)
    (local $l0 (ref func)) (local $l1 (ref func)) (local $l2 (ref func)))
  (func $f1 (type $t0)
    (local $l0 (ref func)) (local $l1 (ref func))
    (try_table $T0
    ))
  (func $f2 (type $t0)
    (local $l0 (ref func))
    (try_table $T0
      (catch $e0 0 (;@0;))
      (catch_all 0 (;@0;))))
  (func $f3 (type $t0)
    (unreachable)
    (try_table $T0
    ))
  (tag $e0 (type $t0)))
;;; STDOUT ;;)
