forked from WebAssembly/binaryen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremove-unused-module-elements-js-called.wast
More file actions
38 lines (31 loc) · 1.08 KB
/
remove-unused-module-elements-js-called.wast
File metadata and controls
38 lines (31 loc) · 1.08 KB
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
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
;; RUN: foreach %s %t wasm-opt --remove-unused-module-elements --closed-world -all -S -o - | filecheck %s
(module
(@binaryen.js.called)
;; CHECK: (type $0 (func))
;; CHECK: (elem declare func $js.called.referred)
;; CHECK: (export "export" (func $export))
;; CHECK: (func $js.called.referred (type $0)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.const 10)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $js.called.referred
;; This is jsCalled, and referred below, so it is kept.
(drop (i32.const 10))
)
;; CHECK: (func $export (type $0)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (ref.func $js.called.referred)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $export (export "export")
(drop (ref.func $js.called.referred))
)
(@binaryen.js.called)
(func $js.called.unreferred
;; This is jsCalled, and not referred anywhere. The annotation does not
;; stop the function from being removed entirely.
(drop (i32.const 20))
)
)