diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/optimize-instructions.txt | 19 | ||||
-rw-r--r-- | test/passes/optimize-instructions.wast | 23 |
2 files changed, 36 insertions, 6 deletions
diff --git a/test/passes/optimize-instructions.txt b/test/passes/optimize-instructions.txt index e4ab82365..3b4718f6a 100644 --- a/test/passes/optimize-instructions.txt +++ b/test/passes/optimize-instructions.txt @@ -669,15 +669,15 @@ (drop (i32.xor (i32.const 127) - (i32.const 128) + (i32.const 126) ) ) (drop (i32.shr_s (i32.shl (i32.xor + (i32.const 127) (i32.const 128) - (i32.const 129) ) (i32.const 24) ) @@ -914,6 +914,21 @@ (i32.const 25) ) ) + (drop + (i32.shr_s + (i32.shl + (i32.xor + (i32.le_u + (get_local $0) + (i32.const 2) + ) + (get_local $0) + ) + (i32.const 24) + ) + (i32.const 24) + ) + ) ) (func $linear-sums (type $4) (param $0 i32) (param $1 i32) (drop diff --git a/test/passes/optimize-instructions.wast b/test/passes/optimize-instructions.wast index 7cfcd7a0d..f8c93d03c 100644 --- a/test/passes/optimize-instructions.wast +++ b/test/passes/optimize-instructions.wast @@ -654,9 +654,9 @@ (drop (i32.shr_s (i32.shl - (i32.xor ;; takes the min, here it is ok + (i32.xor ;; takes the max, here it is ok (i32.const 127) - (i32.const 128) + (i32.const 126) ) (i32.const 24) ) @@ -666,9 +666,9 @@ (drop (i32.shr_s (i32.shl - (i32.xor ;; takes the min, here it is not + (i32.xor ;; takes the max, here it is not + (i32.const 127) (i32.const 128) - (i32.const 129) ) (i32.const 24) ) @@ -1013,6 +1013,21 @@ (i32.const 24) ) ) + (drop ;; fuzz testcase + (i32.shr_s + (i32.shl + (i32.xor ;; should be 32 bits + (i32.le_u ;; 1 bit + (get_local $0) + (i32.const 2) + ) + (get_local $0) ;; unknown, so 32 bits + ) + (i32.const 24) + ) + (i32.const 24) + ) + ) ) (func $linear-sums (param $0 i32) (param $1 i32) (drop |