;;; TOOL: run-roundtrip
;;; ARGS: --stdout --fold-exprs --enable-memory64
(module
  (memory i64 1)
  (func $fold-load
    i64.const 1
    i32.load
    drop
    i64.const 2
    i32.load
    drop)

  (func $fold-store
    i64.const 1
    i64.load
    f32.const 2
    f32.store)

  (func $fold-current-memory (result i32)
    current_memory
    i64.const 1
    i64.add
    drop
    i32.const 2)

  (func $fold-grow-memory (result i32)
    i64.const 1
    i64.const 2
    grow_memory
    i64.lt_s))
(;; STDOUT ;;;
(module
  (type (;0;) (func))
  (type (;1;) (func (result i32)))
  (func (;0;) (type 0)
    (drop
      (i32.load
        (i64.const 1)))
    (drop
      (i32.load
        (i64.const 2))))
  (func (;1;) (type 0)
    (f32.store
      (i64.load
        (i64.const 1))
      (f32.const 0x1p+1 (;=2;))))
  (func (;2;) (type 1) (result i32)
    (drop
      (i64.add
        (memory.size)
        (i64.const 1)))
    (i32.const 2))
  (func (;3;) (type 1) (result i32)
    (i64.lt_s
      (i64.const 1)
      (memory.grow
        (i64.const 2))))
  (memory (;0;) i64 1))
;;; STDOUT ;;)
