;;; TOOL: run-roundtrip
;;; ARGS: --stdout --fold-exprs --debug-names
(module
  (func $fold-block (result f32)
    f32.const 2
    block
      f32.const 3
      br 0
    end
    f32.const 1
    f32.add)

  (func $fold-block-br-value (result i32)
    block (result i32)
      i32.const 1
      br 0
    end)

  (func $fold-loop
    loop (result i64)
      br 0
      i64.const 1
    end
    drop)

  (func $fold-loop-br (result i32)
    loop (result i32)
      i32.const 1
      br 0
    end)

  (func $fold-if
    i32.const 1
    if
      nop
      nop
    end)

  (func $fold-if-else
    i32.const 1
    if (result i32)
      i32.const 2
    else
      i32.const 3
    end
    drop)

  (func $fold-if-else-br
    i32.const 1
    if (result i32)
      i32.const 2
      br 0
    else
      i32.const 3
    end
    drop))
(;; STDOUT ;;;
(module
  (type (;0;) (func (result f32)))
  (type (;1;) (func (result i32)))
  (type (;2;) (func))
  (func $fold-block (type 0) (result f32)
    (f32.const 0x1p+1 (;=2;))
    (block  ;; label = @1
      (f32.const 0x1.8p+1 (;=3;))
      (br 0 (;@1;)))
    (f32.const 0x1p+0 (;=1;))
    (f32.add))
  (func $fold-block-br-value (type 1) (result i32)
    (block (result i32)  ;; label = @1
      (br 0 (;@1;)
        (i32.const 1))))
  (func $fold-loop (type 2)
    (drop
      (loop (result i64)  ;; label = @1
        (br 0 (;@1;))
        (i64.const 1))))
  (func $fold-loop-br (type 1) (result i32)
    (loop (result i32)  ;; label = @1
      (i32.const 1)
      (br 0 (;@1;))))
  (func $fold-if (type 2)
    (if  ;; label = @1
      (i32.const 1)
      (then
        (nop)
        (nop))))
  (func $fold-if-else (type 2)
    (drop
      (if (result i32)  ;; label = @1
        (i32.const 1)
        (then
          (i32.const 2))
        (else
          (i32.const 3)))))
  (func $fold-if-else-br (type 2)
    (drop
      (if (result i32)  ;; label = @1
        (i32.const 1)
        (then
          (br 0 (;@1;)
            (i32.const 2)))
        (else
          (i32.const 3))))))
;;; STDOUT ;;)
