summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/simplify-locals.txt35
-rw-r--r--test/passes/simplify-locals.wast31
2 files changed, 66 insertions, 0 deletions
diff --git a/test/passes/simplify-locals.txt b/test/passes/simplify-locals.txt
new file mode 100644
index 000000000..773215ad7
--- /dev/null
+++ b/test/passes/simplify-locals.txt
@@ -0,0 +1,35 @@
+(module
+ (memory 16777216 16777216)
+ (func $b0-yes (param $i1 i32)
+ (local $x i32)
+ (local $y i32)
+ (set_local $x
+ (i32.const 5)
+ )
+ (block $block0
+ (set_local $x
+ (i32.const 7)
+ )
+ )
+ (set_local $x
+ (i32.const 11)
+ )
+ (set_local $x
+ (i32.const 5)
+ )
+ (get_local $y)
+ (block $block1
+ (set_local $x
+ (i32.const 7)
+ )
+ (get_local $y)
+ )
+ (set_local $x
+ (i32.const 11)
+ )
+ (get_local $y)
+ (set_local $x
+ (i32.const 17)
+ )
+ )
+)
diff --git a/test/passes/simplify-locals.wast b/test/passes/simplify-locals.wast
new file mode 100644
index 000000000..fca2f24c7
--- /dev/null
+++ b/test/passes/simplify-locals.wast
@@ -0,0 +1,31 @@
+(module
+ (memory 16777216 16777216)
+ (func $b0-yes (param $i1 i32)
+ (local $x i32)
+ (local $y i32)
+ (set_local $x (i32.const 5))
+ (get_local $x)
+ (block
+ (set_local $x (i32.const 7))
+ (get_local $x)
+ )
+ (set_local $x (i32.const 11))
+ (get_local $x)
+ (set_local $x (i32.const 5))
+ (get_local $y)
+ (block
+ (set_local $x (i32.const 7))
+ (get_local $y)
+ )
+ (set_local $x (i32.const 11))
+ (get_local $y)
+ (set_local $x (i32.const 17))
+ (get_local $x)
+ (get_local $x)
+ (get_local $x)
+ (get_local $x)
+ (get_local $x)
+ (get_local $x)
+ )
+)
+