summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/remove-unused-brs.txt4
-rw-r--r--test/passes/remove-unused-brs_shrink-level=1.txt19
-rw-r--r--test/passes/remove-unused-brs_shrink-level=1.wast20
-rw-r--r--test/wasm-only.fromasm32
4 files changed, 57 insertions, 18 deletions
diff --git a/test/passes/remove-unused-brs.txt b/test/passes/remove-unused-brs.txt
index 3661ef9ae..ab3260a4b 100644
--- a/test/passes/remove-unused-brs.txt
+++ b/test/passes/remove-unused-brs.txt
@@ -173,14 +173,14 @@
)
(func $b14 (type $2) (result i32)
(block $topmost i32
- (select
+ (if i32
+ (i32.const 1)
(block $block1 i32
(i32.const 12)
)
(block $block3 i32
(i32.const 27)
)
- (i32.const 1)
)
)
)
diff --git a/test/passes/remove-unused-brs_shrink-level=1.txt b/test/passes/remove-unused-brs_shrink-level=1.txt
new file mode 100644
index 000000000..0356cc1da
--- /dev/null
+++ b/test/passes/remove-unused-brs_shrink-level=1.txt
@@ -0,0 +1,19 @@
+(module
+ (type $0 (func (param i32)))
+ (type $1 (func))
+ (type $2 (func (result i32)))
+ (memory $0 256 256)
+ (func $b14 (type $2) (result i32)
+ (block $topmost i32
+ (select
+ (block $block1 i32
+ (i32.const 12)
+ )
+ (block $block3 i32
+ (i32.const 27)
+ )
+ (i32.const 1)
+ )
+ )
+ )
+)
diff --git a/test/passes/remove-unused-brs_shrink-level=1.wast b/test/passes/remove-unused-brs_shrink-level=1.wast
new file mode 100644
index 000000000..9698bd899
--- /dev/null
+++ b/test/passes/remove-unused-brs_shrink-level=1.wast
@@ -0,0 +1,20 @@
+(module
+ (memory 256 256)
+ (type $0 (func (param i32)))
+ (type $1 (func))
+ (type $2 (func (result i32)))
+ (func $b14 (type $2) (result i32)
+ (block $topmost i32
+ (if i32 ;; with shrinking, this can become a select
+ (i32.const 1)
+ (block $block1 i32
+ (i32.const 12)
+ )
+ (block $block3 i32
+ (i32.const 27)
+ )
+ )
+ )
+ )
+)
+
diff --git a/test/wasm-only.fromasm b/test/wasm-only.fromasm
index 369d9dcfa..cda8e711f 100644
--- a/test/wasm-only.fromasm
+++ b/test/wasm-only.fromasm
@@ -122,51 +122,51 @@
)
)
(func $i64u-div (param $0 i64) (param $1 i64) (result i64)
- (select
+ (if i64
+ (i64.eqz
+ (get_local $1)
+ )
(i64.const 0)
(i64.div_u
(get_local $0)
(get_local $1)
)
- (i64.eqz
- (get_local $1)
- )
)
)
(func $i64s-div (param $0 i64) (param $1 i64) (result i64)
- (select
+ (if i64
+ (i64.eqz
+ (get_local $1)
+ )
(i64.const 0)
(i64.div_s
(get_local $0)
(get_local $1)
)
- (i64.eqz
- (get_local $1)
- )
)
)
(func $i64u-rem (param $0 i64) (param $1 i64) (result i64)
- (select
+ (if i64
+ (i64.eqz
+ (get_local $1)
+ )
(i64.const 0)
(i64.rem_u
(get_local $0)
(get_local $1)
)
- (i64.eqz
- (get_local $1)
- )
)
)
(func $i64s-rem (param $0 i64) (param $1 i64) (result i64)
- (select
+ (if i64
+ (i64.eqz
+ (get_local $1)
+ )
(i64.const 0)
(i64.rem_s
(get_local $0)
(get_local $1)
)
- (i64.eqz
- (get_local $1)
- )
)
)
(func $test64