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.wast20
1 files changed, 19 insertions, 1 deletions
diff --git a/test/passes/optimize-instructions_all-features.wast b/test/passes/optimize-instructions_all-features.wast
index 934ccc977..60ae8d3c2 100644
--- a/test/passes/optimize-instructions_all-features.wast
+++ b/test/passes/optimize-instructions_all-features.wast
@@ -4638,7 +4638,25 @@
(i64.const -1)
))
)
- (func $rhs-is-neg-const (param $x i32) (param $y i64)
+ (func $rhs-is-const (param $x i32) (param $y i64)
+ ;; signed divs
+ ;; i32(x) / -2147483648 -> x == -2147483648
+ (drop (i32.div_s
+ (local.get $x)
+ (i32.const -2147483648)
+ ))
+ ;; i64(x) / -9223372036854775808 -> x == -9223372036854775808
+ (drop (i64.div_s
+ (local.get $y)
+ (i64.const -9223372036854775808)
+ ))
+ ;; skip
+ (drop (i64.div_s
+ (local.get $y)
+ (i64.const -2147483648)
+ ))
+
+ ;; unsigned divs
;; u32(x) / -2 => x >= -2
(drop (i32.div_u
(local.get $x)