summaryrefslogtreecommitdiff
path: root/test/passes/reorder-locals.wast
diff options
context:
space:
mode:
authorMichael <mbebenita@Michaels-MacBook-Pro-4.local>2016-02-19 13:38:57 -0800
committerMichael <mbebenita@Michaels-MacBook-Pro-4.local>2016-02-19 13:38:57 -0800
commit846579362c2cc2dc4d129abddd01a97be41d01dd (patch)
treecc88c9230b3287c70f90b5688070cccf1598b2da /test/passes/reorder-locals.wast
parent47b9763af12799e1845677106de1f9c0a00ee2c4 (diff)
downloadbinaryen-846579362c2cc2dc4d129abddd01a97be41d01dd.tar.gz
binaryen-846579362c2cc2dc4d129abddd01a97be41d01dd.tar.bz2
binaryen-846579362c2cc2dc4d129abddd01a97be41d01dd.zip
Reorder locals.
Diffstat (limited to 'test/passes/reorder-locals.wast')
-rw-r--r--test/passes/reorder-locals.wast18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/passes/reorder-locals.wast b/test/passes/reorder-locals.wast
new file mode 100644
index 000000000..282f7ff98
--- /dev/null
+++ b/test/passes/reorder-locals.wast
@@ -0,0 +1,18 @@
+(module
+ (memory 16777216 16777216)
+ (func $b0-yes (param $a i32) (param $b i32)
+ (local $x i32)
+ (local $y i32)
+ (local $z i32)
+
+ ;; Should reverse the order of the locals.
+ (set_local $x (get_local $x))
+ (set_local $y (get_local $y)) (set_local $y (get_local $y))
+ (set_local $z (get_local $z)) (set_local $z (get_local $z)) (set_local $z (get_local $z))
+
+ ;; Should not touch the args.
+ (set_local $b (get_local $b)) (set_local $b (get_local $b)) (set_local $b (get_local $b))
+ (set_local $b (get_local $b)) (set_local $b (get_local $b)) (set_local $b (get_local $b))
+ )
+)
+