;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
;; NOTE: This test was ported using port_passes_tests_to_lit.py and could be cleaned up.

;; RUN: foreach %s %t wasm-opt --precompute --coalesce-locals --vacuum -S -o - | filecheck %s

(module
 ;; CHECK:      (type $0 (func (param i32) (result i32)))

 ;; CHECK:      (func $nested-br_if-value (param $0 i32) (result i32)
 ;; CHECK-NEXT:  (loop $label$0
 ;; CHECK-NEXT:   (br $label$0)
 ;; CHECK-NEXT:  )
 ;; CHECK-NEXT: )
 (func $nested-br_if-value (param $var$0 i32) (result i32)
  (local $1 i32)
  (local $2 i32)
  (loop $label$0 (result i32)
   (drop
    (i32.const 2)
   )
   (block (result i32)
    (local.set $2
     (i32.const 4)
    )
    (br_if $label$0 ;; precomputing this into a br must change the type
     (i32.const 1)
    )
    (local.get $2)
   )
  )
 )
)
