summaryrefslogtreecommitdiff
path: root/test/lit/passes/optimize-instructions-gc-iit.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/passes/optimize-instructions-gc-iit.wast')
-rw-r--r--test/lit/passes/optimize-instructions-gc-iit.wast71
1 files changed, 70 insertions, 1 deletions
diff --git a/test/lit/passes/optimize-instructions-gc-iit.wast b/test/lit/passes/optimize-instructions-gc-iit.wast
index c0d84ab1c..e30fac8a8 100644
--- a/test/lit/passes/optimize-instructions-gc-iit.wast
+++ b/test/lit/passes/optimize-instructions-gc-iit.wast
@@ -1,18 +1,26 @@
;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.
;; RUN: wasm-opt %s --optimize-instructions --ignore-implicit-traps --enable-reference-types --enable-gc -S -o - \
;; RUN: | filecheck %s
+;; RUN: wasm-opt %s --optimize-instructions --ignore-implicit-traps --enable-reference-types --enable-gc --nominal -S -o - \
+;; RUN: | filecheck %s --check-prefix NOMNL
(module
;; CHECK: (type $parent (struct (field i32)))
+ ;; NOMNL: (type $parent (struct (field i32)))
(type $parent (struct (field i32)))
;; CHECK: (type $child (struct (field i32) (field f64)))
- (type $child (struct (field i32) (field f64)))
+ ;; NOMNL: (type $child (struct (field i32) (field f64)) (extends $parent))
+ (type $child (struct (field i32) (field f64)) (extends $parent))
;; CHECK: (type $other (struct (field i64) (field f32)))
+ ;; NOMNL: (type $other (struct (field i64) (field f32)))
(type $other (struct (field i64) (field f32)))
;; CHECK: (func $foo
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: )
+ ;; NOMNL: (func $foo
+ ;; NOMNL-NEXT: (nop)
+ ;; NOMNL-NEXT: )
(func $foo)
@@ -46,6 +54,36 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
+ ;; NOMNL: (func $ref-cast-iit (param $parent (ref $parent)) (param $child (ref $child)) (param $other (ref $other)) (param $parent-rtt (rtt $parent)) (param $child-rtt (rtt $child)) (param $other-rtt (rtt $other))
+ ;; NOMNL-NEXT: (drop
+ ;; NOMNL-NEXT: (block (result (ref $parent))
+ ;; NOMNL-NEXT: (drop
+ ;; NOMNL-NEXT: (local.get $parent-rtt)
+ ;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: (local.get $parent)
+ ;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: (drop
+ ;; NOMNL-NEXT: (block (result (ref $child))
+ ;; NOMNL-NEXT: (drop
+ ;; NOMNL-NEXT: (local.get $parent-rtt)
+ ;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: (local.get $child)
+ ;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: (drop
+ ;; NOMNL-NEXT: (ref.cast
+ ;; NOMNL-NEXT: (local.get $parent)
+ ;; NOMNL-NEXT: (local.get $child-rtt)
+ ;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: (drop
+ ;; NOMNL-NEXT: (ref.cast
+ ;; NOMNL-NEXT: (local.get $child)
+ ;; NOMNL-NEXT: (local.get $other-rtt)
+ ;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: )
(func $ref-cast-iit
(param $parent (ref $parent))
(param $child (ref $child))
@@ -111,6 +149,32 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
+ ;; NOMNL: (func $ref-cast-iit-bad (param $parent (ref $parent)) (param $parent-rtt (rtt $parent))
+ ;; NOMNL-NEXT: (drop
+ ;; NOMNL-NEXT: (ref.cast
+ ;; NOMNL-NEXT: (block $block (result (ref $parent))
+ ;; NOMNL-NEXT: (call $foo)
+ ;; NOMNL-NEXT: (local.get $parent)
+ ;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: (block $block0 (result (rtt $parent))
+ ;; NOMNL-NEXT: (call $foo)
+ ;; NOMNL-NEXT: (local.get $parent-rtt)
+ ;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: (drop
+ ;; NOMNL-NEXT: (ref.cast
+ ;; NOMNL-NEXT: (local.get $parent)
+ ;; NOMNL-NEXT: (unreachable)
+ ;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: (drop
+ ;; NOMNL-NEXT: (ref.cast
+ ;; NOMNL-NEXT: (unreachable)
+ ;; NOMNL-NEXT: (local.get $parent-rtt)
+ ;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: )
(func $ref-cast-iit-bad
(param $parent (ref $parent))
(param $parent-rtt (rtt $parent))
@@ -149,6 +213,11 @@
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
+ ;; NOMNL: (func $ref-eq-ref-cast (param $x eqref)
+ ;; NOMNL-NEXT: (drop
+ ;; NOMNL-NEXT: (i32.const 1)
+ ;; NOMNL-NEXT: )
+ ;; NOMNL-NEXT: )
(func $ref-eq-ref-cast (param $x eqref)
;; we can look through a ref.cast if we ignore traps
(drop