;;; TOOL: run-roundtrip
;;; ARGS: --stdout --debug-names --generate-names

(module
  (func (export "my_func"))
  (table (export "my_table") 1 funcref)
  (memory (export "my_memory") 1)
  (global (export "my_global") i32 (i32.const 1))

  ;; Handle name collisions
  (func $foo (result i32)
    (i32.const 123))
  (func $foo_1 (result i32)
    (i32.const 456))
  (func (export "foo") (result i32)
    (i32.const 789))
)
(;; STDOUT ;;;
(module
  (type $t0 (func))
  (type $t1 (func (result i32)))
  (func $my_func (type $t0))
  (func $foo (type $t1) (result i32)
    i32.const 123)
  (func $foo_1 (type $t1) (result i32)
    i32.const 456)
  (func $foo_2 (type $t1) (result i32)
    i32.const 789)
  (table $my_table 1 funcref)
  (memory $my_memory 1)
  (global $my_global i32 (i32.const 1))
  (export "my_func" (func $my_func))
  (export "my_table" (table $my_table))
  (export "my_memory" (memory $my_memory))
  (export "my_global" (global $my_global))
  (export "foo" (func $foo_2)))
;;; STDOUT ;;)
