summaryrefslogtreecommitdiff
path: root/test/passes
diff options
context:
space:
mode:
Diffstat (limited to 'test/passes')
-rw-r--r--test/passes/inlining-optimizing_optimize-level=3.txt48
-rw-r--r--test/passes/remove-unused-names_merge-blocks.txt387
-rw-r--r--test/passes/remove-unused-names_merge-blocks.wast226
3 files changed, 637 insertions, 24 deletions
diff --git a/test/passes/inlining-optimizing_optimize-level=3.txt b/test/passes/inlining-optimizing_optimize-level=3.txt
index a7ec5e4aa..bbcaf9591 100644
--- a/test/passes/inlining-optimizing_optimize-level=3.txt
+++ b/test/passes/inlining-optimizing_optimize-level=3.txt
@@ -2710,12 +2710,12 @@
(i32.const 32)
)
)
- (set_local $6
- (get_local $1)
- )
- (set_local $1
- (get_local $12)
- )
+ )
+ (set_local $6
+ (get_local $1)
+ )
+ (set_local $1
+ (get_local $12)
)
)
(set_local $1
@@ -6293,9 +6293,9 @@
)
)
)
- (set_local $5
- (get_local $7)
- )
+ )
+ (set_local $5
+ (get_local $7)
)
)
)
@@ -6544,9 +6544,9 @@
)
)
)
- (set_local $5
- (get_local $8)
- )
+ )
+ (set_local $5
+ (get_local $8)
)
(set_local $8
(if (result i32)
@@ -6816,9 +6816,9 @@
(get_local $5)
)
)
- (set_local $7
- (get_local $5)
- )
+ )
+ (set_local $7
+ (get_local $5)
)
)
(set_local $7
@@ -9544,12 +9544,12 @@
)
)
)
- (set_local $3
- (get_local $1)
- )
- (set_local $4
- (get_local $0)
- )
+ )
+ (set_local $3
+ (get_local $1)
+ )
+ (set_local $4
+ (get_local $0)
)
)
(if (result i32)
@@ -11235,9 +11235,9 @@
)
)
)
- (set_local $4
- (i32.const 624)
- )
+ )
+ (set_local $4
+ (i32.const 624)
)
(br $__rjto$11)
)
diff --git a/test/passes/remove-unused-names_merge-blocks.txt b/test/passes/remove-unused-names_merge-blocks.txt
index a46cacf47..410febead 100644
--- a/test/passes/remove-unused-names_merge-blocks.txt
+++ b/test/passes/remove-unused-names_merge-blocks.txt
@@ -930,4 +930,391 @@
)
)
)
+ (func $block-tails (; 32 ;) (type $3)
+ (block $l1
+ (drop
+ (i32.const -2)
+ )
+ (drop
+ (i32.const -1)
+ )
+ (br $l1)
+ (drop
+ (i32.const 0)
+ )
+ (drop
+ (i32.const 1)
+ )
+ )
+ (block $l2
+ (br_if $l2
+ (i32.const 2)
+ )
+ (drop
+ (i32.const 3)
+ )
+ )
+ (block $l3
+ (br_if $l3
+ (i32.const 4)
+ )
+ (br_if $l3
+ (i32.const 5)
+ )
+ (drop
+ (i32.const 6)
+ )
+ )
+ (block $l4
+ (br_if $l4
+ (i32.const 7)
+ )
+ (br_if $l4
+ (i32.const 8)
+ )
+ (drop
+ (i32.const 9)
+ )
+ )
+ (block $l5
+ (if
+ (i32.const 10)
+ (br_if $l5
+ (i32.const 11)
+ )
+ )
+ (drop
+ (i32.const 12)
+ )
+ )
+ (block $l8
+ (br_if $l8
+ (i32.const 13)
+ )
+ (br_if $l8
+ (i32.const 14)
+ )
+ (br_if $l8
+ (i32.const 15)
+ )
+ (drop
+ (i32.const 16)
+ )
+ )
+ (block $l11
+ (br_if $l11
+ (i32.const 17)
+ )
+ (br_if $l11
+ (i32.const 18)
+ )
+ (br_if $l11
+ (i32.const 19)
+ )
+ (drop
+ (i32.const 20)
+ )
+ )
+ (block $l12
+ (block $l13
+ (block $l14
+ (br_if $l12
+ (i32.const 21)
+ )
+ (br_if $l13
+ (i32.const 22)
+ )
+ (br_if $l14
+ (i32.const 23)
+ )
+ (drop
+ (i32.const 24)
+ )
+ )
+ (drop
+ (i32.const 25)
+ )
+ )
+ (drop
+ (i32.const 26)
+ )
+ )
+ (block $l15
+ (block $l16
+ (block $l17
+ (drop
+ (i32.const 27)
+ )
+ (br_if $l17
+ (i32.const 28)
+ )
+ (drop
+ (i32.const 29)
+ )
+ )
+ (br_if $l16
+ (i32.const 30)
+ )
+ (drop
+ (i32.const 31)
+ )
+ )
+ (br_if $l15
+ (i32.const 32)
+ )
+ (drop
+ (i32.const 33)
+ )
+ )
+ )
+ (func $loop-tails (; 33 ;) (type $3)
+ (loop $l1
+ (drop
+ (i32.const -2)
+ )
+ (drop
+ (i32.const -1)
+ )
+ (br $l1)
+ )
+ (drop
+ (i32.const 0)
+ )
+ (drop
+ (i32.const 1)
+ )
+ (loop $l2
+ (br_if $l2
+ (i32.const 2)
+ )
+ )
+ (drop
+ (i32.const 3)
+ )
+ (block $b1
+ (loop $l3
+ (br_if $b1
+ (i32.const 4)
+ )
+ (br_if $l3
+ (i32.const 5)
+ )
+ )
+ (drop
+ (i32.const 6)
+ )
+ )
+ (block $b2
+ (loop $l4
+ (br_if $l4
+ (i32.const 7)
+ )
+ )
+ (br_if $b2
+ (i32.const 8)
+ )
+ (drop
+ (i32.const 9)
+ )
+ )
+ (loop $l5
+ (if
+ (i32.const 10)
+ (br_if $l5
+ (i32.const 11)
+ )
+ )
+ )
+ (drop
+ (i32.const 12)
+ )
+ (loop $l6
+ (loop $l7
+ (loop $l8
+ (br_if $l6
+ (i32.const 13)
+ )
+ (br_if $l7
+ (i32.const 14)
+ )
+ (br_if $l8
+ (i32.const 15)
+ )
+ (drop
+ (i32.const 16)
+ )
+ )
+ )
+ )
+ (loop $l9
+ (loop $l10
+ (loop $l11
+ (br_if $l11
+ (i32.const 17)
+ )
+ (br_if $l10
+ (i32.const 18)
+ )
+ (br_if $l9
+ (i32.const 19)
+ )
+ (drop
+ (i32.const 20)
+ )
+ )
+ )
+ )
+ (loop $l12
+ (loop $l13
+ (loop $l14
+ (br_if $l12
+ (i32.const 21)
+ )
+ (br_if $l13
+ (i32.const 22)
+ )
+ (br_if $l14
+ (i32.const 23)
+ )
+ )
+ )
+ )
+ (drop
+ (i32.const 24)
+ )
+ (drop
+ (i32.const 25)
+ )
+ (drop
+ (i32.const 26)
+ )
+ (loop $l15
+ (loop $l16
+ (loop $l17
+ (drop
+ (i32.const 27)
+ )
+ (br_if $l17
+ (i32.const 28)
+ )
+ )
+ (drop
+ (i32.const 29)
+ )
+ (br_if $l16
+ (i32.const 30)
+ )
+ )
+ (drop
+ (i32.const 31)
+ )
+ (br_if $l15
+ (i32.const 32)
+ )
+ )
+ (drop
+ (i32.const 33)
+ )
+ )
+ (func $block-tail-one (; 34 ;) (type $3)
+ (block $l1
+ (drop
+ (i32.const -2)
+ )
+ (drop
+ (i32.const -1)
+ )
+ (br $l1)
+ (drop
+ (i32.const 0)
+ )
+ (drop
+ (i32.const 1)
+ )
+ )
+ (drop
+ (i32.const 2)
+ )
+ )
+ (func $loop-tail-one (; 35 ;) (type $3)
+ (loop $l1
+ (drop
+ (i32.const -2)
+ )
+ (drop
+ (i32.const -1)
+ )
+ (br $l1)
+ )
+ (drop
+ (i32.const 0)
+ )
+ (drop
+ (i32.const 1)
+ )
+ (drop
+ (i32.const 2)
+ )
+ )
+ (func $block-tail-value (; 36 ;) (type $4) (result i32)
+ (block $l1 (result i32)
+ (drop
+ (i32.const -1)
+ )
+ (br $l1
+ (i32.const 0)
+ )
+ (drop
+ (i32.const 1)
+ )
+ (i32.const 2)
+ )
+ )
+ (func $block-tail-empty (; 37 ;) (type $3)
+ (block $l1
+ (drop
+ (i32.const -1)
+ )
+ (br $l1)
+ )
+ )
+ (func $loop-tail-empty (; 38 ;) (type $3)
+ (loop $l1
+ (drop
+ (i32.const -1)
+ )
+ (br $l1)
+ )
+ )
+ (func $block-tail-unreachable (; 39 ;) (type $4) (result i32)
+ (block $l1 (result i32)
+ (drop
+ (i32.const -1)
+ )
+ (drop
+ (br_if $l1
+ (i32.const 0)
+ (i32.const 1)
+ )
+ )
+ (drop
+ (i32.const 1)
+ )
+ (unreachable)
+ )
+ )
+ (func $loop-tail-unreachable (; 40 ;) (type $4) (result i32)
+ (loop $l1
+ (drop
+ (i32.const -1)
+ )
+ (br_if $l1
+ (i32.const 1)
+ )
+ )
+ (drop
+ (i32.const 1)
+ )
+ (unreachable)
+ )
)
diff --git a/test/passes/remove-unused-names_merge-blocks.wast b/test/passes/remove-unused-names_merge-blocks.wast
index 920664b4b..cd11135f0 100644
--- a/test/passes/remove-unused-names_merge-blocks.wast
+++ b/test/passes/remove-unused-names_merge-blocks.wast
@@ -1095,5 +1095,231 @@
)
)
)
+ (func $block-tails
+ (block $l1
+ (drop (i32.const -2))
+ (drop (i32.const -1))
+ (br $l1)
+ (drop (i32.const 0))
+ (drop (i32.const 1))
+ )
+ (block $l2
+ (br_if $l2 (i32.const 2))
+ (drop (i32.const 3))
+ )
+ (block $b1
+ (block $l3
+ (br_if $b1 (i32.const 4))
+ (br_if $l3 (i32.const 5))
+ (drop (i32.const 6))
+ )
+ )
+ (block $b2
+ (block $l4
+ (br_if $l4 (i32.const 7))
+ (br_if $b2 (i32.const 8))
+ (drop (i32.const 9))
+ )
+ )
+ (block $l5
+ (if (i32.const 10)
+ (br_if $l5 (i32.const 11))
+ )
+ (drop (i32.const 12))
+ )
+ (block $l6
+ (block $l7
+ (block $l8
+ (br_if $l6 (i32.const 13))
+ (br_if $l7 (i32.const 14))
+ (br_if $l8 (i32.const 15))
+ (drop (i32.const 16))
+ )
+ )
+ )
+ (block $l9
+ (block $l10
+ (block $l11
+ (br_if $l11 (i32.const 17))
+ (br_if $l10 (i32.const 18))
+ (br_if $l9 (i32.const 19))
+ (drop (i32.const 20))
+ )
+ )
+ )
+ (block $l12
+ (block $l13
+ (block $l14
+ (br_if $l12 (i32.const 21))
+ (br_if $l13 (i32.const 22))
+ (br_if $l14 (i32.const 23))
+ (drop (i32.const 24))
+ )
+ (drop (i32.const 25))
+ )
+ (drop (i32.const 26))
+ )
+ (block $l15
+ (block $l16
+ (block $l17
+ (drop (i32.const 27))
+ (br_if $l17 (i32.const 28))
+ (drop (i32.const 29))
+ )
+ (br_if $l16 (i32.const 30))
+ (drop (i32.const 31))
+ )
+ (br_if $l15 (i32.const 32))
+ (drop (i32.const 33))
+ )
+ )
+ (func $loop-tails
+ (loop $l1
+ (drop (i32.const -2))
+ (drop (i32.const -1))
+ (br $l1)
+ (drop (i32.const 0))
+ (drop (i32.const 1))
+ )
+ (loop $l2
+ (br_if $l2 (i32.const 2))
+ (drop (i32.const 3))
+ )
+ (block $b1
+ (loop $l3
+ (br_if $b1 (i32.const 4))
+ (br_if $l3 (i32.const 5))
+ (drop (i32.const 6))
+ )
+ )
+ (block $b2
+ (loop $l4
+ (br_if $l4 (i32.const 7))
+ (br_if $b2 (i32.const 8))
+ (drop (i32.const 9))
+ )
+ )
+ (loop $l5
+ (if (i32.const 10)
+ (br_if $l5 (i32.const 11))
+ )
+ (drop (i32.const 12))
+ )
+ (loop $l6
+ (loop $l7
+ (loop $l8
+ (br_if $l6 (i32.const 13))
+ (br_if $l7 (i32.const 14))
+ (br_if $l8 (i32.const 15))
+ (drop (i32.const 16))
+ )
+ )
+ )
+ (loop $l9
+ (loop $l10
+ (loop $l11
+ (br_if $l11 (i32.const 17))
+ (br_if $l10 (i32.const 18))
+ (br_if $l9 (i32.const 19))
+ (drop (i32.const 20))
+ )
+ )
+ )
+ (loop $l12
+ (loop $l13
+ (loop $l14
+ (br_if $l12 (i32.const 21))
+ (br_if $l13 (i32.const 22))
+ (br_if $l14 (i32.const 23))
+ (drop (i32.const 24))
+ )
+ (drop (i32.const 25))
+ )
+ (drop (i32.const 26))
+ )
+ (loop $l15
+ (loop $l16
+ (loop $l17
+ (drop (i32.const 27))
+ (br_if $l17 (i32.const 28))
+ (drop (i32.const 29))
+ )
+ (br_if $l16 (i32.const 30))
+ (drop (i32.const 31))
+ )
+ (br_if $l15 (i32.const 32))
+ (drop (i32.const 33))
+ )
+ )
+ (func $block-tail-one
+ (block $outer
+ (block $l1
+ (drop (i32.const -2))
+ (drop (i32.const -1))
+ (br $l1)
+ (drop (i32.const 0))
+ (drop (i32.const 1))
+ )
+ (drop (i32.const 2))
+ )
+ )
+ (func $loop-tail-one
+ (block $outer
+ (loop $l1
+ (drop (i32.const -2))
+ (drop (i32.const -1))
+ (br $l1)
+ (drop (i32.const 0))
+ (drop (i32.const 1))
+ )
+ (drop (i32.const 2))
+ )
+ )
+ (func $block-tail-value (result i32)
+ (block $outer (result i32)
+ (block $l1 (result i32)
+ (drop (i32.const -1))
+ (br $l1 (i32.const 0))
+ (drop (i32.const 1))
+ (i32.const 2)
+ )
+ )
+ )
+ (func $block-tail-empty
+ (block $outer
+ (block $l1
+ (drop (i32.const -1))
+ (br $l1)
+ )
+ )
+ )
+ (func $loop-tail-empty
+ (block $outer
+ (loop $l1
+ (drop (i32.const -1))
+ (br $l1)
+ )
+ )
+ )
+ (func $block-tail-unreachable (result i32)
+ (block $outer (result i32)
+ (block $l1 (result i32)
+ (drop (i32.const -1))
+ (drop (br_if $l1 (i32.const 0) (i32.const 1)))
+ (drop (i32.const 1))
+ (unreachable)
+ )
+ )
+ )
+ (func $loop-tail-unreachable (result i32)
+ (block $outer (result i32)
+ (loop $l1 (result i32)
+ (drop (i32.const -1))
+ (br_if $l1 (i32.const 1))
+ (drop (i32.const 1))
+ (unreachable)
+ )
+ )
+ )
)