summaryrefslogtreecommitdiff
path: root/test/lit/passes/generate-dyncalls-wasm64.wast
blob: c8dfba32e12a1c4fdef93c5cf0397b8de82777ed (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
;; RUN: wasm-opt %s --generate-dyncalls --enable-memory64 -S -o - | filecheck %s

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

 ;; CHECK:      (type $1 (func (param i32) (result i64)))

 ;; CHECK:      (type $2 (func (param i64) (result i32)))

 ;; CHECK:      (type $3 (func (param i64 i32) (result i64)))

 ;; CHECK:      (memory $m i64 1)
 (memory $m i64 1)
 ;; CHECK:      (table $t i64 2 2 funcref)
 (table $t i64 2 2 funcref)
 ;; CHECK:      (elem $elem (i64.const 0) $f1 $f2)
 (elem $elem (i64.const 0) $f1 $f2)

 ;; CHECK:      (export "dynCall_i" (func $dynCall_i))

 ;; CHECK:      (export "dynCall_ji" (func $dynCall_ji))

 ;; CHECK:      (func $f1 (result i32)
 ;; CHECK-NEXT:  (i32.const 1024)
 ;; CHECK-NEXT: )
 (func $f1 (result i32)
  (i32.const 1024)
 )
 ;; CHECK:      (func $f2 (param $0 i32) (result i64)
 ;; CHECK-NEXT:  (i64.const 42)
 ;; CHECK-NEXT: )
 (func $f2 (param i32) (result i64)
  (i64.const 42)
 )
)
;; CHECK:      (func $dynCall_i (param $fptr i64) (result i32)
;; CHECK-NEXT:  (call_indirect (type $0)
;; CHECK-NEXT:   (local.get $fptr)
;; CHECK-NEXT:  )
;; CHECK-NEXT: )

;; CHECK:      (func $dynCall_ji (param $fptr i64) (param $0 i32) (result i64)
;; CHECK-NEXT:  (call_indirect (type $1)
;; CHECK-NEXT:   (local.get $0)
;; CHECK-NEXT:   (local.get $fptr)
;; CHECK-NEXT:  )
;; CHECK-NEXT: )