summaryrefslogtreecommitdiff
path: root/test/passes/optimize-instructions_fuzz-exec.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/passes/optimize-instructions_fuzz-exec.wast')
-rw-r--r--test/passes/optimize-instructions_fuzz-exec.wast25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/passes/optimize-instructions_fuzz-exec.wast b/test/passes/optimize-instructions_fuzz-exec.wast
index 8bd43b694..87b6eb594 100644
--- a/test/passes/optimize-instructions_fuzz-exec.wast
+++ b/test/passes/optimize-instructions_fuzz-exec.wast
@@ -287,6 +287,31 @@
)
)
)
+ (func $shift (param $0 i32)
+ (call $log
+ ;; x << 24 >> 24 << 30 >> 24 - the extra shifts make it invalid to do the
+ ;; optimization of not repeating a sign-extend. That is, this would be valid
+ ;; if the 30 were replaced by a 24.
+ (i32.shr_s
+ (i32.shl
+ (i32.shr_s
+ (i32.shl
+ (local.get $0)
+ (i32.const 24)
+ )
+ (i32.const 24)
+ )
+ (i32.const 30)
+ )
+ (i32.const 24)
+ )
+ )
+ )
+ (func "do-shift"
+ (call $shift
+ (i32.const 65419)
+ )
+ )
;; similar, but with the value compared to having the sign bit set but no
;; upper bits
(func $compare-maybe-signed-eq (param $0 i32) (result i32)