summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lit/passes/rse-gc.wast15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/lit/passes/rse-gc.wast b/test/lit/passes/rse-gc.wast
new file mode 100644
index 000000000..7bea92260
--- /dev/null
+++ b/test/lit/passes/rse-gc.wast
@@ -0,0 +1,15 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.
+;; RUN: wasm-opt %s --rse --enable-gc-nn-locals -all -S -o - | filecheck %s
+
+(module
+ ;; CHECK: (func $10
+ ;; CHECK-NEXT: (local $1 (ref func))
+ ;; CHECK-NEXT: (nop)
+ ;; CHECK-NEXT: )
+ (func $10
+ ;; A non-nullable local. The pass should ignore it (as we cannot optimize
+ ;; anything here anyhow: the code must assign to the local before reading from
+ ;; it, so no sets can be redundant in that sense).
+ (local $1 (ref func))
+ )
+)