summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/optimize-instructions.txt19
-rw-r--r--test/passes/optimize-instructions.wast25
2 files changed, 44 insertions, 0 deletions
diff --git a/test/passes/optimize-instructions.txt b/test/passes/optimize-instructions.txt
index 68599ceb7..18d9b1a18 100644
--- a/test/passes/optimize-instructions.txt
+++ b/test/passes/optimize-instructions.txt
@@ -2179,4 +2179,23 @@
(i32.const -31744)
)
)
+ (func $return-proper-value-from-shift-left-by-zero (type $2) (result i32)
+ (if (result i32)
+ (i32.add
+ (loop $label$0 (result i32)
+ (block $label$1
+ (br_if $label$1
+ (i32.load
+ (i32.const 0)
+ )
+ )
+ )
+ (i32.const -62)
+ )
+ (i32.const 40)
+ )
+ (i32.const 1)
+ (i32.const 0)
+ )
+ )
)
diff --git a/test/passes/optimize-instructions.wast b/test/passes/optimize-instructions.wast
index a4478b755..ff5bd9f9d 100644
--- a/test/passes/optimize-instructions.wast
+++ b/test/passes/optimize-instructions.wast
@@ -2615,4 +2615,29 @@
(i32.const -1024)
)
)
+ (func $return-proper-value-from-shift-left-by-zero (result i32)
+ (if (result i32)
+ (i32.sub
+ (i32.add
+ (loop $label$0 (result i32)
+ (block $label$1
+ (br_if $label$1
+ (i32.shl
+ (i32.load
+ (i32.const 0)
+ )
+ (i32.const -31904) ;; really 0 shifts
+ )
+ )
+ )
+ (i32.const -62)
+ )
+ (i32.const 38)
+ )
+ (i32.const -2)
+ )
+ (i32.const 1)
+ (i32.const 0)
+ )
+ )
)