diff options
author | Max Graey <maxgraey@gmail.com> | 2020-07-09 03:01:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-08 17:01:56 -0700 |
commit | ec5a88c12bea053200c4529758cf1f5ce916e455 (patch) | |
tree | 443c09caf8bb6e6cb025d8171c7bdc5b30c2d9bf /test/passes/optimize-instructions_all-features.wast | |
parent | 18095a6c6030fb157f89889b8094eca0b3f654cb (diff) | |
download | binaryen-ec5a88c12bea053200c4529758cf1f5ce916e455.tar.gz binaryen-ec5a88c12bea053200c4529758cf1f5ce916e455.tar.bz2 binaryen-ec5a88c12bea053200c4529758cf1f5ce916e455.zip |
Optimize booleans when argument is negative integer (#2930)
bool(-x) ==> bool(x)
Diffstat (limited to 'test/passes/optimize-instructions_all-features.wast')
-rw-r--r-- | test/passes/optimize-instructions_all-features.wast | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/passes/optimize-instructions_all-features.wast b/test/passes/optimize-instructions_all-features.wast index a0fff2936..c62f0bc42 100644 --- a/test/passes/optimize-instructions_all-features.wast +++ b/test/passes/optimize-instructions_all-features.wast @@ -3766,6 +3766,18 @@ ) ) ) + (func $optimize-boolean (param $x i32) + (drop + (select + (i32.const 1) + (i32.const 2) + (i32.sub ;; bool(-x) -> bool(x) + (i32.const 0) + (local.get $x) + ) + ) + ) + ) (func $getFallthrough ;; unit tests for Properties::getFallthrough (local $x0 i32) (local $x1 i32) |