summaryrefslogtreecommitdiff
path: root/test/binaryen.js/stackir.js.txt
diff options
context:
space:
mode:
Diffstat (limited to 'test/binaryen.js/stackir.js.txt')
-rw-r--r--test/binaryen.js/stackir.js.txt50
1 files changed, 50 insertions, 0 deletions
diff --git a/test/binaryen.js/stackir.js.txt b/test/binaryen.js/stackir.js.txt
new file mode 100644
index 000000000..f0985ee5c
--- /dev/null
+++ b/test/binaryen.js/stackir.js.txt
@@ -0,0 +1,50 @@
+=== input wast ===
+(module
+ (type $i (func (param i32) (result i32)))
+ (memory $0 0)
+ (export "test" (func $test))
+ (func $test (; 0 ;) (type $i) (param $0 i32) (result i32)
+ (block (result i32)
+ (block (result i32)
+ (if (result i32)
+ (get_local $0)
+ (get_local $0)
+ (i32.const 0)
+ )
+ )
+ )
+ )
+)
+
+=== default ===
+(module
+ (type $i (func (param i32) (result i32)))
+ (memory $0 0)
+ (export "test" (func $test))
+ (func $test (; 0 ;) (; has Stack IR ;) (type $i) (param $0 i32) (result i32)
+ block $block0 (result i32)
+ get_local $0
+ if (result i32)
+ get_local $0
+ else
+ i32.const 0
+ end
+ end
+ )
+)
+
+=== optimize ===
+(module
+ (type $i (func (param i32) (result i32)))
+ (memory $0 0)
+ (export "test" (func $test))
+ (func $test (; 0 ;) (; has Stack IR ;) (type $i) (param $0 i32) (result i32)
+ get_local $0
+ if (result i32)
+ get_local $0
+ else
+ i32.const 0
+ end
+ )
+)
+