summaryrefslogtreecommitdiff
path: root/test/passes/optimize-instructions.wast
diff options
context:
space:
mode:
authorAlon Zakai (kripken) <alonzakai@gmail.com>2017-02-12 17:06:34 -0800
committerAlon Zakai (kripken) <alonzakai@gmail.com>2017-02-16 22:45:38 -0800
commit8a4edd97499120430fe1c6f2fdcbb0f5920cceab (patch)
treeb78556b69485b63aaac42dbcd0cd31e9a39eec1c /test/passes/optimize-instructions.wast
parent6affe6fb4d06550a40b4d73efe19c085317854d7 (diff)
downloadbinaryen-8a4edd97499120430fe1c6f2fdcbb0f5920cceab.tar.gz
binaryen-8a4edd97499120430fe1c6f2fdcbb0f5920cceab.tar.bz2
binaryen-8a4edd97499120430fe1c6f2fdcbb0f5920cceab.zip
handle fallthrough values in load_s/u and sign/zero-extend optimization
Diffstat (limited to 'test/passes/optimize-instructions.wast')
-rw-r--r--test/passes/optimize-instructions.wast47
1 files changed, 47 insertions, 0 deletions
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)
+ )
+ )
)
)