Add gas test confirming that br instructions do not end blocks.

This commit is contained in:
Jim Posen
2019-06-26 12:50:43 +02:00
parent 89e13ee901
commit 863744b1fc
6 changed files with 65 additions and 7 deletions
+27
View File
@@ -0,0 +1,27 @@
(module
(func $fibonacci_with_break (result i32)
(local $x i32) (local $y i32)
(block $unrolled_loop
(set_local $x (i32.const 0))
(set_local $y (i32.const 1))
get_local $x
get_local $y
tee_local $x
i32.add
set_local $y
i32.const 1
br_if $unrolled_loop
get_local $x
get_local $y
tee_local $x
i32.add
set_local $y
)
get_local $y
)
)
-1
View File
@@ -2,7 +2,6 @@
(func $add_locals (param $x i32) (param $y i32) (result i32)
(local $t i32)
;; This looks
get_local $x
get_local $y
call $add
+3 -3
View File
@@ -1,9 +1,9 @@
(module
(func (param $x i32) (result i32)
(if (result i32)
(i32.const 1)
(i32.add (get_local $x) (i32.const 1))
(i32.popcnt (get_local $x))
(i32.const 1)
(then (i32.add (get_local $x) (i32.const 1)))
(else (i32.popcnt (get_local $x)))
)
)
)
+5 -3
View File
@@ -1,9 +1,11 @@
(module
(func (export "simple")
(if (i32.const 1)
(loop
i32.const 123
drop
(then
(loop
i32.const 123
drop
)
)
)
)