summaryrefslogtreecommitdiff
path: root/test/lit/passes/remove-unused-module-elements-refs.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/passes/remove-unused-module-elements-refs.wast')
-rw-r--r--test/lit/passes/remove-unused-module-elements-refs.wast50
1 files changed, 30 insertions, 20 deletions
diff --git a/test/lit/passes/remove-unused-module-elements-refs.wast b/test/lit/passes/remove-unused-module-elements-refs.wast
index 61ccb4daf..61315384d 100644
--- a/test/lit/passes/remove-unused-module-elements-refs.wast
+++ b/test/lit/passes/remove-unused-module-elements-refs.wast
@@ -1,33 +1,39 @@
;; 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 --nominal -all -S -o - | filecheck %s
-;; RUN: foreach %s %t wasm-opt --remove-unused-module-elements --nominal -all -S -o - | filecheck %s --check-prefix OPEN_WORLD
+;; RUN: foreach %s %t wasm-opt --remove-unused-module-elements --closed-world -all -S -o - | filecheck %s
+;; RUN: foreach %s %t wasm-opt --remove-unused-module-elements -all -S -o - | filecheck %s --check-prefix OPEN_WORLD
;; Test both open world (default) and closed world. In a closed world we can do
;; more with function refs, as we assume nothing calls them on the outside, so
;; if no calls exist to the right type, the function is not reached.
(module
- ;; CHECK: (type $A-super (func))
- ;; OPEN_WORLD: (type $A-super (func))
- (type $A-super (func))
+ (rec
+ ;; CHECK: (rec
+ ;; CHECK-NEXT: (type $A-super (func))
+ ;; OPEN_WORLD: (rec
+ ;; OPEN_WORLD-NEXT: (type $A-super (func))
+ (type $A-super (func))
- ;; CHECK: (type $A (func_subtype $A-super))
- ;; OPEN_WORLD: (type $A (func_subtype $A-super))
- (type $A (func_subtype $A-super))
+ ;; CHECK: (type $A (func_subtype $A-super))
+ ;; OPEN_WORLD: (type $A (func_subtype $A-super))
+ (type $A (func_subtype $A-super))
- ;; CHECK: (type $A-sub (func_subtype $A))
- ;; OPEN_WORLD: (type $A-sub (func_subtype $A))
- (type $A-sub (func_subtype $A))
+ ;; CHECK: (type $A-sub (func_subtype $A))
+ ;; OPEN_WORLD: (type $A-sub (func_subtype $A))
+ (type $A-sub (func_subtype $A))
- ;; CHECK: (type $B (func))
- ;; OPEN_WORLD: (type $B (func))
- (type $B (func))
+ ;; CHECK: (type $B (func))
+ ;; OPEN_WORLD: (type $B (func))
+ (type $B (func))
+ )
+
+ ;; CHECK: (type $none_=>_none (func))
;; CHECK: (elem declare func $target-A $target-A-sub $target-A-super $target-B)
;; CHECK: (export "foo" (func $foo))
- ;; CHECK: (func $foo (type $A-super)
+ ;; CHECK: (func $foo (type $none_=>_none)
;; CHECK-NEXT: (local $A (ref null $A))
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (ref.func $target-A)
@@ -51,11 +57,13 @@
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
+ ;; OPEN_WORLD: (type $none_=>_none (func))
+
;; OPEN_WORLD: (elem declare func $target-A $target-A-sub $target-A-super $target-B)
;; OPEN_WORLD: (export "foo" (func $foo))
- ;; OPEN_WORLD: (func $foo (type $A-super)
+ ;; OPEN_WORLD: (func $foo (type $none_=>_none)
;; OPEN_WORLD-NEXT: (local $A (ref null $A))
;; OPEN_WORLD-NEXT: (drop
;; OPEN_WORLD-NEXT: (ref.func $target-A)
@@ -1161,11 +1169,13 @@
;; Cycles.
(module
(rec
- ;; CHECK: (type $vtable-func (func (param (ref $vtable))))
- ;; OPEN_WORLD: (type $vtable-func (func (param (ref $vtable))))
+ ;; CHECK: (rec
+ ;; CHECK-NEXT: (type $vtable-func (func (param (ref $vtable))))
+ ;; OPEN_WORLD: (rec
+ ;; OPEN_WORLD-NEXT: (type $vtable-func (func (param (ref $vtable))))
(type $vtable-func (func (param (ref $vtable))))
- ;; CHECK: (type $vtable (struct (field (ref $vtable-func)) (field (ref $vtable-func))))
- ;; OPEN_WORLD: (type $vtable (struct (field (ref $vtable-func)) (field (ref $vtable-func))))
+ ;; CHECK: (type $vtable (struct (field (ref $vtable-func)) (field (ref $vtable-func))))
+ ;; OPEN_WORLD: (type $vtable (struct (field (ref $vtable-func)) (field (ref $vtable-func))))
(type $vtable (struct_subtype (field (ref $vtable-func)) (field (ref $vtable-func)) data))
)