Skip to content

Address test #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions ml-proto/test/expected-output/address.wast.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
97 : i32
98 : i32
99 : i32
122 : i32
25185 : i32
25442 : i32
25699 : i32
122 : i32
1684234849 : i32
1701077858 : i32
1717920867 : i32
122 : i32
0 : i32
0 : i32
0 : i32
0 : i32
0 : i32
0 : i32
0 : i32
0 : i32
0 : i32
0 : i32
0 : i32
0 : i32
0 : i32
0 : i32
0 : i32
0 : i32
0 : i32
0 : i32
0 : i32
0 : i32
0 : i32
0 : i32
0 : i32
14 changes: 14 additions & 0 deletions ml-proto/test/labels.wast
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@
)
)

(func $loop4 (param $max i32) (result i32)
(local $i i32)
(set_local $i (i32.const 1))
(loop $exit $cont
(set_local $i (i32.add (get_local $i) (get_local $i)))
(if (i32.gt_u (get_local $i) (get_local $max))
(br $exit (get_local $i))
)
(br $cont)
)
)

(func $switch (param i32) (result i32)
(label $ret
(i32.mul (i32.const 10)
Expand Down Expand Up @@ -91,6 +103,7 @@
(export "loop1" $loop1)
(export "loop2" $loop2)
(export "loop3" $loop3)
(export "loop4" $loop4)
(export "switch" $switch)
(export "return" $return)
(export "br_if" $br_if)
Expand All @@ -100,6 +113,7 @@
(assert_return (invoke "loop1") (i32.const 5))
(assert_return (invoke "loop2") (i32.const 8))
(assert_return (invoke "loop3") (i32.const 1))
(assert_return (invoke "loop4" (i32.const 8)) (i32.const 16))
(assert_return (invoke "switch" (i32.const 0)) (i32.const 50))
(assert_return (invoke "switch" (i32.const 1)) (i32.const 20))
(assert_return (invoke "switch" (i32.const 2)) (i32.const 20))
Expand Down