summaryrefslogtreecommitdiff
path: root/test/passes
diff options
context:
space:
mode:
Diffstat (limited to 'test/passes')
-rw-r--r--test/passes/lower-if-else.txt52
-rw-r--r--test/passes/lower-if-else.wast21
2 files changed, 73 insertions, 0 deletions
diff --git a/test/passes/lower-if-else.txt b/test/passes/lower-if-else.txt
new file mode 100644
index 000000000..2245f7230
--- /dev/null
+++ b/test/passes/lower-if-else.txt
@@ -0,0 +1,52 @@
+printing before:
+(module
+ (memory 16777216 16777216)
+ (func $ifs
+ (block
+ (if
+ (i32.const 0)
+ (i32.const 1)
+ )
+ (if_else
+ (i32.const 0)
+ (i32.const 1)
+ (i32.const 2)
+ )
+ (if_else
+ (i32.const 4)
+ (i32.const 5)
+ (i32.const 6)
+ )
+ )
+ )
+)
+printing after:
+(module
+ (memory 16777216 16777216)
+ (func $ifs
+ (block
+ (if
+ (i32.const 0)
+ (i32.const 1)
+ )
+ (block $L0
+ (if
+ (i32.const 0)
+ (br $L0
+ (i32.const 1)
+ )
+ )
+ (i32.const 2)
+ )
+ (block $L1
+ (if
+ (i32.const 4)
+ (br $L1
+ (i32.const 5)
+ )
+ )
+ (i32.const 6)
+ )
+ )
+ )
+)
diff --git a/test/passes/lower-if-else.wast b/test/passes/lower-if-else.wast
new file mode 100644
index 000000000..70251a469
--- /dev/null
+++ b/test/passes/lower-if-else.wast
@@ -0,0 +1,21 @@
+(module
+ (memory 16777216 16777216)
+ (func $ifs
+ (block
+ (if
+ (i32.const 0)
+ (i32.const 1)
+ )
+ (if_else
+ (i32.const 0)
+ (i32.const 1)
+ (i32.const 2)
+ )
+ (if_else
+ (i32.const 4)
+ (i32.const 5)
+ (i32.const 6)
+ )
+ )
+ )
+)