summaryrefslogtreecommitdiff
path: root/test/passes
diff options
context:
space:
mode:
Diffstat (limited to 'test/passes')
-rw-r--r--test/passes/optimize-instructions.txt12
-rw-r--r--test/passes/optimize-instructions.wast9
2 files changed, 21 insertions, 0 deletions
diff --git a/test/passes/optimize-instructions.txt b/test/passes/optimize-instructions.txt
index c93c7d1fa..1bd410822 100644
--- a/test/passes/optimize-instructions.txt
+++ b/test/passes/optimize-instructions.txt
@@ -1,6 +1,7 @@
(module
(type $0 (func (param i32 i64)))
(type $1 (func))
+ (type $2 (func (result i32)))
(memory $0 0)
(func $f (type $0) (param $i1 i32) (param $i2 i64)
(if
@@ -363,4 +364,15 @@
)
)
)
+ (func $ne0 (type $2) (result i32)
+ (if
+ (call $ne0)
+ (nop)
+ )
+ (if
+ (call $ne0)
+ (nop)
+ )
+ (i32.const 1)
+ )
)
diff --git a/test/passes/optimize-instructions.wast b/test/passes/optimize-instructions.wast
index 99e77ea9e..56e9d08fb 100644
--- a/test/passes/optimize-instructions.wast
+++ b/test/passes/optimize-instructions.wast
@@ -287,4 +287,13 @@
(drop (i32.div_s (unreachable) (i32.const 1))) ;; not ok
(drop (i32.div_s (i32.const 1) (unreachable)))
)
+ (func $ne0 (result i32)
+ (if (i32.ne (call $ne0) (i32.const 0))
+ (nop)
+ )
+ (if (i32.ne (i32.const 0) (call $ne0))
+ (nop)
+ )
+ (i32.const 1)
+ )
)