summaryrefslogtreecommitdiff
path: root/test/lit/passes/legalize-js-interface_pass-arg=legalize-js-interface-export-originals.wast
blob: f56db7982c23d31ce15f0955fbd3d00971136ff3 (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
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
;; NOTE: This test was ported using port_passes_tests_to_lit.py and could be cleaned up.

;; RUN: foreach %s %t wasm-opt --legalize-js-interface --pass-arg=legalize-js-interface-export-originals -S -o - | filecheck %s

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

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

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

  ;; CHECK:      (import "env" "setTempRet0" (func $setTempRet0 (param i32)))

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

  ;; CHECK:      (export "orig$func" (func $func))
  (export "func" (func $func))
  ;; CHECK:      (func $func (result i64)
  ;; CHECK-NEXT:  (unreachable)
  ;; CHECK-NEXT: )
  (func $func (result i64)
    (unreachable)
  )
)

;; CHECK:      (func $legalstub$func (result i32)
;; CHECK-NEXT:  (local $0 i64)
;; CHECK-NEXT:  (local.set $0
;; CHECK-NEXT:   (call $func)
;; CHECK-NEXT:  )
;; CHECK-NEXT:  (call $setTempRet0
;; CHECK-NEXT:   (i32.wrap_i64
;; CHECK-NEXT:    (i64.shr_u
;; CHECK-NEXT:     (local.get $0)
;; CHECK-NEXT:     (i64.const 32)
;; CHECK-NEXT:    )
;; CHECK-NEXT:   )
;; CHECK-NEXT:  )
;; CHECK-NEXT:  (i32.wrap_i64
;; CHECK-NEXT:   (local.get $0)
;; CHECK-NEXT:  )
;; CHECK-NEXT: )