summaryrefslogtreecommitdiff
path: root/test/passes
diff options
context:
space:
mode:
Diffstat (limited to 'test/passes')
-rw-r--r--test/passes/lower-if-else.txt50
-rw-r--r--test/passes/lower-if-else.wast21
-rw-r--r--test/passes/remove-imports.txt23
-rw-r--r--test/passes/remove-imports.wast11
4 files changed, 105 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..6e7ce9e66
--- /dev/null
+++ b/test/passes/lower-if-else.txt
@@ -0,0 +1,50 @@
+(module
+ (memory 16777216 16777216)
+ (func $ifs
+ (block $block0
+ (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)
+ )
+ )
+ )
+)
+(module
+ (memory 16777216 16777216)
+ (func $ifs
+ (block $block0
+ (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)
+ )
+ )
+ )
+)
diff --git a/test/passes/remove-imports.txt b/test/passes/remove-imports.txt
new file mode 100644
index 000000000..f28068a27
--- /dev/null
+++ b/test/passes/remove-imports.txt
@@ -0,0 +1,23 @@
+(module
+ (memory 1024 1024)
+ (import $waka "somewhere" "waka")
+ (import $waka-ret "somewhere" "waka-ret" (result i32))
+ (import $waka-ret-d "somewhere" "waka-ret-d" (result f64))
+ (func $nada
+ (block
+ (call_import $waka)
+ (call_import $waka-ret)
+ (call_import $waka-ret-d)
+ )
+ )
+)
+(module
+ (memory 1024 1024)
+ (func $nada
+ (block
+ (nop)
+ (i32.const 0)
+ (f64.const 0)
+ )
+ )
+)
diff --git a/test/passes/remove-imports.wast b/test/passes/remove-imports.wast
new file mode 100644
index 000000000..00190a32d
--- /dev/null
+++ b/test/passes/remove-imports.wast
@@ -0,0 +1,11 @@
+(module
+ (memory 1024 1024)
+ (import $waka "somewhere" "waka")
+ (import $waka-ret "somewhere" "waka-ret" (result i32))
+ (import $waka-ret-d "somewhere" "waka-ret-d" (result f64))
+ (func $nada
+ (call_import $waka)
+ (call_import $waka-ret)
+ (call_import $waka-ret-d)
+ )
+)