summaryrefslogtreecommitdiff
path: root/test/lit/passes/jspi-split-module.wast
blob: e14e508bf7003c6b21112a68c9473ab22d17d9c7 (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
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
;; RUN: wasm-opt %s --jspi --pass-arg=jspi-split-module -all -S -o - | filecheck %s

;; The following should be generated besides the usual JSPI wasm:
;;  - function import
;;  - JSPI'ed version of the import
;;  - export of the above
(module)
;; CHECK:      (type $0 (func))

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

;; CHECK:      (import "env" "__load_secondary_module" (func $import$__load_secondary_module (type $1) (param externref)))

;; CHECK:      (global $suspender (mut externref) (ref.null noextern))

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

;; CHECK:      (func $__load_secondary_module (type $0)
;; CHECK-NEXT:  (local $0 externref)
;; CHECK-NEXT:  (local.set $0
;; CHECK-NEXT:   (global.get $suspender)
;; CHECK-NEXT:  )
;; CHECK-NEXT:  (call $import$__load_secondary_module
;; CHECK-NEXT:   (global.get $suspender)
;; CHECK-NEXT:  )
;; CHECK-NEXT:  (global.set $suspender
;; CHECK-NEXT:   (local.get $0)
;; CHECK-NEXT:  )
;; CHECK-NEXT: )