summaryrefslogtreecommitdiff
path: root/test/regress/regress-18.txt
blob: 6299deae22e09ddec1541088a59c1150eb442cd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
;;; TOOL: run-roundtrip
;;; ARGS: --stdout --fold-exprs --generate-names

;; This was folding incorrectly since the import index was being used as the
;; function index, so the folder didn't know how many parameters the function
;; had.

(module
  (import "a" "b" (global i32))
  (import "c" "d" (func $g (param i32 i32) (result i32)))
  (func $f (param i32))
  (func
    (call $f
      (call $g
        (i32.const 1)
        (i32.const 2)))))

(;; STDOUT ;;;
(module
  (type $t0 (func (param i32 i32) (result i32)))
  (type $t1 (func (param i32)))
  (type $t2 (func))
  (import "a" "b" (global $a.b i32))
  (import "c" "d" (func $c.d (type $t0)))
  (func $f1 (type $t1) (param $p0 i32))
  (func $f2 (type $t2)
    (call $f1
      (call $c.d
        (i32.const 1)
        (i32.const 2)))))
;;; STDOUT ;;)