Skip to content
Merged
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
4 changes: 2 additions & 2 deletions ml-proto/TestingTodo.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Operator semantics:
- ~~test that call and store operands are evaluated left-to-right too~~
- ~~test that call and argument operands of call_indirect are evaluated left-to-right, too~~
- ~~test that select arguments are evaluated left-to-right, too~~
- test that br_if arguments are evaluated left-to-right, too
- test that tableswitch arguments are evaluated left-to-right, too
- ~~test that br_if arguments are evaluated left-to-right, too~~
- ~~test that br_table arguments are evaluated left-to-right, too~~
- ~~test that add/sub/mul/wrap/wrapping-store silently wrap on overflow~~
- ~~test that sdiv/udiv/srem/urem trap on divide-by-zero~~
- ~~test that sdiv traps on overflow~~
Expand Down
22 changes: 22 additions & 0 deletions ml-proto/test/left-to-right.wast
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,22 @@
(func $f64_call_indirect (result i32) (call $reset) (call_indirect $f64_T (call $f64_callee) (call $f64_right) (call $f64_another)) (call $get))
(func $f64_select (result i32) (call $reset) (select (call $f64_left) (call $f64_right) (call $f64_bool)) (call $get))

(func $br_if (result i32)
(block
(call $reset)
(br_if 0 (call $i32_left) (i32.and (call $i32_right) (i32.const 0)))
(call $get)
)
)
(func $br_table (result i32)
(block $a
(call $reset)
(block $b
(br_table $a $b (call $i32_left) (call $i32_right))
)
(call $get)
)
)

(export "i32_add" $i32_add) (export "i64_add" $i64_add)
(export "i32_sub" $i32_sub) (export "i64_sub" $i64_sub)
Expand Down Expand Up @@ -205,6 +221,9 @@
(export "f32_call" $f32_call) (export "f64_call" $f64_call)
(export "f32_call_indirect" $f32_call_indirect) (export "f64_call_indirect" $f64_call_indirect)
(export "f32_select" $f32_select) (export "f64_select" $f64_select)

(export "br_if" $br_if)
(export "br_table" $br_table)
)

(assert_return (invoke "i32_add") (i32.const 0x0102)) (assert_return (invoke "i64_add") (i32.const 0x0102))
Expand Down Expand Up @@ -257,3 +276,6 @@
(assert_return (invoke "f32_call_indirect") (i32.const 0x040203))
(assert_return (invoke "f64_call_indirect") (i32.const 0x040203))
(assert_return (invoke "f32_select") (i32.const 0x010205)) (assert_return (invoke "f64_select") (i32.const 0x010205))

(assert_return (invoke "br_if") (i32.const 0x0102))
(assert_return (invoke "br_table") (i32.const 0x0102))