diff options
Diffstat (limited to 'test/passes')
-rw-r--r-- | test/passes/optimize-instructions.txt | 37 | ||||
-rw-r--r-- | test/passes/optimize-instructions.wast | 47 |
2 files changed, 84 insertions, 0 deletions
diff --git a/test/passes/optimize-instructions.txt b/test/passes/optimize-instructions.txt index 01f1070f7..e4ab82365 100644 --- a/test/passes/optimize-instructions.txt +++ b/test/passes/optimize-instructions.txt @@ -1237,5 +1237,42 @@ (i32.const 256) ) ) + (drop + (tee_local $1 + (i32.load8_s + (i32.const 1) + ) + ) + ) + (drop + (i32.shr_s + (i32.shl + (tee_local $1 + (i32.load8_u + (i32.const 1) + ) + ) + (i32.const 24) + ) + (i32.const 24) + ) + ) + (drop + (i32.and + (tee_local $1 + (i32.load8_s + (i32.const 1) + ) + ) + (i32.const 255) + ) + ) + (drop + (tee_local $1 + (i32.load8_u + (i32.const 1) + ) + ) + ) ) ) diff --git a/test/passes/optimize-instructions.wast b/test/passes/optimize-instructions.wast index 9cdec0a6c..7cfcd7a0d 100644 --- a/test/passes/optimize-instructions.wast +++ b/test/passes/optimize-instructions.wast @@ -1562,5 +1562,52 @@ (i32.const 16) ) ) + ;; through tees, we cannot alter the load sign + (drop + (i32.shr_s + (i32.shl + (tee_local $1 + (i32.load8_s + (i32.const 1) + ) + ) + (i32.const 24) + ) + (i32.const 24) + ) + ) + (drop + (i32.shr_s + (i32.shl + (tee_local $1 + (i32.load8_u + (i32.const 1) + ) + ) + (i32.const 24) + ) + (i32.const 24) + ) + ) + (drop + (i32.and + (tee_local $1 + (i32.load8_s + (i32.const 1) + ) + ) + (i32.const 255) + ) + ) + (drop + (i32.and + (tee_local $1 + (i32.load8_u + (i32.const 1) + ) + ) + (i32.const 255) + ) + ) ) ) |