summaryrefslogtreecommitdiff
path: root/test/passes/optimize-instructions_all-features.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/passes/optimize-instructions_all-features.wast')
-rw-r--r--test/passes/optimize-instructions_all-features.wast24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/passes/optimize-instructions_all-features.wast b/test/passes/optimize-instructions_all-features.wast
index cf3938cdf..934ccc977 100644
--- a/test/passes/optimize-instructions_all-features.wast
+++ b/test/passes/optimize-instructions_all-features.wast
@@ -4395,6 +4395,30 @@
)
(i64.const 1)
))
+ ;; i32(bool(expr)) != 0 -> i32(bool(expr))
+ (drop (i32.ne
+ (i32.and
+ (local.get $x)
+ (i32.const 1)
+ )
+ (i32.const 0)
+ ))
+ ;; i32(bool(expr)) != 0 -> i32(bool(expr))
+ (drop (i32.ne
+ (i64.ne
+ (local.get $y)
+ (i64.const 0)
+ )
+ (i32.const 0)
+ ))
+ ;; (i32(expr) != 0) != 0 -> (expr != 0)
+ (drop (i32.ne
+ (i32.ne
+ (local.get $x)
+ (i32.const 0)
+ )
+ (i32.const 0)
+ ))
)
(func $optimize-bitwise-oprations (param $x i32) (param $y i32) (param $z i64) (param $w i64)
;; ~(1 << x) -> rotl(-2, x)