summaryrefslogtreecommitdiff
path: root/test/passes/optimize-instructions.wast
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-08-02 14:47:05 -0700
committerGitHub <noreply@github.com>2017-08-02 14:47:05 -0700
commitde15161e110f26212095c5cf4faf2e3668d2531b (patch)
tree915e18978f4b554d0479b568378a425ec5b042ee /test/passes/optimize-instructions.wast
parent5a07a930ad51003411b2bc827ea9bf08728ecc5a (diff)
parent6d686bd1a5b3610ad49fd607ae5e49c70410af51 (diff)
downloadbinaryen-de15161e110f26212095c5cf4faf2e3668d2531b.tar.gz
binaryen-de15161e110f26212095c5cf4faf2e3668d2531b.tar.bz2
binaryen-de15161e110f26212095c5cf4faf2e3668d2531b.zip
Merge pull request #1119 from WebAssembly/fuzz-2
More fun fuzz fixes
Diffstat (limited to 'test/passes/optimize-instructions.wast')
-rw-r--r--test/passes/optimize-instructions.wast70
1 files changed, 70 insertions, 0 deletions
diff --git a/test/passes/optimize-instructions.wast b/test/passes/optimize-instructions.wast
index 8362453e9..c26aad196 100644
--- a/test/passes/optimize-instructions.wast
+++ b/test/passes/optimize-instructions.wast
@@ -2496,4 +2496,74 @@
(i32.const 4098) ;; 2 bits effectively
)
)
+ (func $mix-shifts (result i32)
+ (i32.shr_s
+ (i32.shl
+ (i32.const 23)
+ (i32.const -61)
+ )
+ (i32.const 168)
+ )
+ )
+ (func $actually-no-shifts (result i32)
+ (i32.add
+ (i32.shl
+ (i32.const 23)
+ (i32.const 32) ;; really 0
+ )
+ (i32.const 10)
+ )
+ )
+ (func $less-shifts-than-it-seems (param $x i32) (result i32)
+ (i32.add
+ (i32.shl
+ (i32.const 200)
+ (i32.const 36) ;; really 4
+ )
+ (i32.shl
+ (i32.const 100)
+ (i32.const 4)
+ )
+ )
+ )
+ (func $and-popcount32 (result i32)
+ (i32.and
+ (i32.popcnt
+ (i32.const -1)
+ )
+ (i32.const 31)
+ )
+ )
+ (func $and-popcount32-big (result i32)
+ (i32.and
+ (i32.popcnt
+ (i32.const -1)
+ )
+ (i32.const 63)
+ )
+ )
+ (func $and-popcount64 (result i64) ;; these are TODOs
+ (i64.and
+ (i64.popcnt
+ (i64.const -1)
+ )
+ (i64.const 63)
+ )
+ )
+ (func $and-popcount64-big (result i64)
+ (i64.and
+ (i64.popcnt
+ (i64.const -1)
+ )
+ (i64.const 127)
+ )
+ )
+ (func $and-popcount64-bigger (result i64)
+ (i64.and
+ (i64.popcnt
+ (i64.const -1)
+ )
+ (i64.const 255)
+ )
+ )
)