summaryrefslogtreecommitdiff
path: root/test/lit/passes
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/passes')
-rw-r--r--test/lit/passes/O3_Oz.wast45
-rw-r--r--test/lit/passes/skip-missing.wast8
2 files changed, 45 insertions, 8 deletions
diff --git a/test/lit/passes/O3_Oz.wast b/test/lit/passes/O3_Oz.wast
new file mode 100644
index 000000000..a60064778
--- /dev/null
+++ b/test/lit/passes/O3_Oz.wast
@@ -0,0 +1,45 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
+
+;; RUN: foreach %s %t wasm-opt -O3 -Oz -S -o - | filecheck %s
+
+(module
+ (func $inline.me (param $x i32) (result i32)
+ (i32.add
+ (local.get $x)
+ (i32.const 2)
+ )
+ )
+
+ (func "export" (param $x i32) (result i32)
+ ;; $inline.me is called twice, so we do not always inline it like called-
+ ;; once functions are. -Oz is too cautious to inline such things that may
+ ;; end up increasing total code size, but we are running -O3 -Oz here and so
+ ;; the first -O3 will inline there. That is, this test verifies that the
+ ;; later -Oz does not affect the earlier -O3 (which it could, if -Oz set
+ ;; global state that -O3 then reads to see the optimization and shrink
+ ;; levels).
+ (i32.add
+ (call $inline.me
+ (local.get $x)
+ )
+ (call $inline.me
+ (local.get $x)
+ )
+ )
+ )
+)
+;; CHECK: (type $i32_=>_i32 (func (param i32) (result i32)))
+
+;; CHECK: (export "export" (func $1))
+
+;; CHECK: (func $1 (; has Stack IR ;) (param $0 i32) (result i32)
+;; CHECK-NEXT: (i32.add
+;; CHECK-NEXT: (local.tee $0
+;; CHECK-NEXT: (i32.add
+;; CHECK-NEXT: (local.get $0)
+;; CHECK-NEXT: (i32.const 2)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (local.get $0)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
diff --git a/test/lit/passes/skip-missing.wast b/test/lit/passes/skip-missing.wast
deleted file mode 100644
index 02778dab0..000000000
--- a/test/lit/passes/skip-missing.wast
+++ /dev/null
@@ -1,8 +0,0 @@
-;; We should warn on a pass called "waka" not having been run and skipped.
-
-;; RUN: wasm-opt %s -O1 --skip-pass=waka 2>&1 | filecheck %s
-
-;; CHECK: warning: --waka was requested to be skipped, but it was not found in the passes that were run.
-
-(module
-)