summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/local-cse.txt22
-rw-r--r--test/passes/local-cse.wast21
2 files changed, 43 insertions, 0 deletions
diff --git a/test/passes/local-cse.txt b/test/passes/local-cse.txt
new file mode 100644
index 000000000..970a13dd8
--- /dev/null
+++ b/test/passes/local-cse.txt
@@ -0,0 +1,22 @@
+(module
+ (type $0 (func (result i64)))
+ (func $i64-shifts (; 0 ;) (type $0) (result i64)
+ (local $temp i64)
+ (set_local $temp
+ (i64.add
+ (i64.const 1)
+ (i64.const 2)
+ )
+ )
+ (set_local $temp
+ (i64.const 9999)
+ )
+ (set_local $temp
+ (i64.add
+ (i64.const 1)
+ (i64.const 2)
+ )
+ )
+ (get_local $temp)
+ )
+)
diff --git a/test/passes/local-cse.wast b/test/passes/local-cse.wast
new file mode 100644
index 000000000..23ea6ff68
--- /dev/null
+++ b/test/passes/local-cse.wast
@@ -0,0 +1,21 @@
+(module
+ (func $i64-shifts (result i64)
+ (local $temp i64)
+ (set_local $temp
+ (i64.add
+ (i64.const 1)
+ (i64.const 2)
+ )
+ )
+ (set_local $temp
+ (i64.const 9999)
+ )
+ (set_local $temp
+ (i64.add
+ (i64.const 1)
+ (i64.const 2)
+ )
+ )
+ (get_local $temp)
+ )
+)