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.wast46
1 files changed, 46 insertions, 0 deletions
diff --git a/test/passes/optimize-instructions_all-features.wast b/test/passes/optimize-instructions_all-features.wast
index 80f440a59..cf3938cdf 100644
--- a/test/passes/optimize-instructions_all-features.wast
+++ b/test/passes/optimize-instructions_all-features.wast
@@ -2,6 +2,52 @@
(memory 0)
(type $0 (func (param i32 i64)))
(func $f (type $0) (param $i1 i32) (param $i2 i64)
+ (drop
+ (i32.and
+ (i32.and
+ (local.get $i1)
+ (i32.const 5)
+ )
+ (i32.const 3)
+ )
+ )
+ (drop
+ (i32.or
+ (i32.or
+ (local.get $i1)
+ (i32.const 1)
+ )
+ (i32.const 2)
+ )
+ )
+ (drop
+ (i32.xor
+ (i32.xor
+ (local.get $i1)
+ (i32.const -2)
+ )
+ (i32.const -5)
+ )
+ )
+ (drop
+ (i32.mul
+ (i32.mul
+ (local.get $i1)
+ (i32.const -2)
+ )
+ (i32.const 5)
+ )
+ )
+ ;; overflow also valid
+ (drop
+ (i32.mul
+ (i32.mul
+ (local.get $i1)
+ (i32.const 0xfffff)
+ )
+ (i32.const 0x8000001)
+ )
+ )
(if
(i32.eqz
(local.get $i1)