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
9 changes: 2 additions & 7 deletions ml-proto/test/block.wast
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
(block i32
(br 0 (i32.const 18))
(br 0 (i32.const 19))
(br_if 0 (i32.const 20) (i32.const 0))
(br_if 0 (i32.const 20) (i32.const 1))
(drop (br_if 0 (i32.const 20) (i32.const 0)))
(drop (br_if 0 (i32.const 20) (i32.const 1)))
(br 0 (i32.const 21))
(br_table 0 (i32.const 22) (i32.const 4))
(br_table 0 0 0 (i32.const 23) (i32.const 1))
Expand Down Expand Up @@ -198,11 +198,6 @@
)
;)

;; TODO(stack): move this elsewhere
(module (func $type-break-num-vs-void
(block (i32.const 66) (br 0))
))

(assert_invalid
(module (func $type-break-last-void-vs-num (result i32)
(block i32 (br 0))
Expand Down
6 changes: 3 additions & 3 deletions ml-proto/test/br.wast
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
(block i32 (br_if 0 (br 0 (i32.const 8)) (i32.const 1)) (i32.const 7))
)
(func (export "as-br_if-value-cond") (result i32)
(block i32 (br_if 0 (i32.const 6) (br 0 (i32.const 9))) (i32.const 7))
(block i32 (drop (br_if 0 (i32.const 6) (br 0 (i32.const 9)))) (i32.const 7))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

He he, most of these are probably also fixed in #345.

)

(func (export "as-br_table-index")
Expand Down Expand Up @@ -247,7 +247,7 @@
(i32.const 1)
(block i32
(drop (i32.const 2))
(br_if 0 (i32.const 4) (br 0 (i32.const 8)))
(drop (br_if 0 (i32.const 4) (br 0 (i32.const 8))))
(i32.const 16)
)
)
Expand Down Expand Up @@ -373,7 +373,7 @@

;; TODO(stack): move this elsewhere
(module (func $type-arg-num-vs-void
(block (i32.const 0) (br 0))
(block (drop (i32.const 0)) (br 0))
))

(; TODO(stack): soft failure
Expand Down
4 changes: 2 additions & 2 deletions ml-proto/test/br_if.wast
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
(block (call $dummy) (call $dummy) (br_if 0 (get_local 0)))
)
(func (export "as-block-first-value") (param i32) (result i32)
(block i32 (br_if 0 (i32.const 10) (get_local 0)) (return (i32.const 11)))
(block i32 (drop (br_if 0 (i32.const 10) (get_local 0))) (return (i32.const 11)))
Copy link
Contributor

@titzer titzer Sep 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why a drop is required here, since br_if leaves its value on the stack in the false case, and then falls off the end of the block, and the block is annotated as i32.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return is also in that block, i.e. with indentation it looks like this:

(block $block0 i32
  (br_if $block0
    (i32.const 10)
    (get_local $0)
  )
  (return
    (i32.const 11)
  )
)

)
(func (export "as-block-mid-value") (param i32) (result i32)
(block i32 (call $dummy) (br_if 0 (i32.const 20) (get_local 0)) (return (i32.const 21)))
(block i32 (call $dummy) (drop (br_if 0 (i32.const 20) (get_local 0))) (return (i32.const 21)))
)
(func (export "as-block-last-value") (param i32) (result i32)
(block i32
Expand Down
9 changes: 2 additions & 7 deletions ml-proto/test/br_table.wast
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@
)
(func (export "as-br_if-value-cond") (result i32)
(block i32
(br_if 0 (i32.const 6) (br_table 0 0 (i32.const 9) (i32.const 0)))
(drop (br_if 0 (i32.const 6) (br_table 0 0 (i32.const 9) (i32.const 0))))
(i32.const 7)
)
)
Expand Down Expand Up @@ -1158,7 +1158,7 @@
(i32.const 1)
(block i32
(drop (i32.const 2))
(br_if 0 (i32.const 4) (br_table 0 1 0 (i32.const 8) (get_local 0)))
(drop (br_if 0 (i32.const 4) (br_table 0 1 0 (i32.const 8) (get_local 0))))
(i32.const 16)
)
)
Expand Down Expand Up @@ -1382,11 +1382,6 @@
"type mismatch"
)

;; TODO(stack): move this elsewhere
(module (func $type-arg-num-vs-void
(block (br_table 0 (i32.const 0) (i32.const 1)))
))

(; TODO(stack): soft failure
(assert_invalid
(module (func $type-arg-poly-vs-empty
Expand Down
8 changes: 0 additions & 8 deletions ml-proto/test/call.wast
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,6 @@
"type mismatch"
)

;; TODO(stack): move these elsewhere
(module
(func (param i32 i32))
(func $arity-nop-first (call 0 (nop) (i32.const 1) (i32.const 2)))
(func $arity-nop-mid (call 0 (i32.const 1) (nop) (i32.const 2)))
(func $arity-nop-last (call 0 (i32.const 1) (i32.const 2) (nop)))
)

(assert_invalid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Equivalent tests exist in nop.wast, so you can just delete this.

(module
(func $type-first-void-vs-num (call 1 (nop) (i32.const 1)))
Expand Down
15 changes: 0 additions & 15 deletions ml-proto/test/call_indirect.wast
Original file line number Diff line number Diff line change
Expand Up @@ -285,21 +285,6 @@
"type mismatch"
)

;; TODO(stack): move these elsewhere
(module
(type (func (param i32 i32)))
(table 0 anyfunc)
(func $arity-nop-first
(call_indirect 0 (nop) (i32.const 1) (i32.const 2) (i32.const 0))
)
(func $arity-nop-mid
(call_indirect 0 (i32.const 1) (nop) (i32.const 2) (i32.const 0))
)
(func $arity-nop-last
(call_indirect 0 (i32.const 1) (i32.const 2) (nop) (i32.const 0))
)
)

(assert_invalid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, this can just go away.

(module
(type (func (param i32)))
Expand Down
5 changes: 0 additions & 5 deletions ml-proto/test/func.wast
Original file line number Diff line number Diff line change
Expand Up @@ -475,11 +475,6 @@
)
;)

;; TODO(stack): move this elsewhere
(module (func $type-break-last-num-vs-void
(i32.const 0) (br 0)
))

(assert_invalid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is subsumed by unwind.wast (#344) as well.

(module (func $type-break-last-void-vs-num (result i32)
(br 0)
Expand Down
11 changes: 2 additions & 9 deletions ml-proto/test/loop.wast
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
(loop i32
(br 1 (i32.const 18))
(br 1 (i32.const 19))
(br_if 1 (i32.const 20) (i32.const 0))
(br_if 1 (i32.const 20) (i32.const 1))
(drop (br_if 1 (i32.const 20) (i32.const 0)))
(drop (br_if 1 (i32.const 20) (i32.const 1)))
(br 1 (i32.const 21))
(br_table 1 (i32.const 22) (i32.const 0))
(br_table 1 1 1 (i32.const 23) (i32.const 1))
Expand Down Expand Up @@ -280,10 +280,3 @@
"type mismatch"
)

;; TODO(stack): move these elsewhere
(module (func $type-cont-num-vs-void
(loop (i32.const 0) (br 0))
))
(module (func $type-cont-nested-num-vs-void
(block (loop (i32.const 1) (loop (i32.const 1) (br 2)) (br 1)))
))
2 changes: 1 addition & 1 deletion ml-proto/test/return.wast
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
(block i32 (br_if 0 (return (i32.const 8)) (i32.const 1)) (i32.const 7))
)
(func (export "as-br_if-value-cond") (result i32)
(block i32 (br_if 0 (i32.const 6) (return (i32.const 9))) (i32.const 7))
(block i32 (drop (br_if 0 (i32.const 6) (return (i32.const 9)))) (i32.const 7))
)

(func (export "as-br_table-index") (result i64)
Expand Down
5 changes: 5 additions & 0 deletions ml-proto/test/stack.wast
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,8 @@
(assert_return (invoke "fac-stack" (i64.const 25)) (i64.const 7034535277573963776))
(assert_return (invoke "fac-mixed" (i64.const 25)) (i64.const 7034535277573963776))

;; from br_table.wast
(module (func $type-arg-num-vs-void
(block (br_table 0 (i32.const 0) (i32.const 1)))
))

2 changes: 1 addition & 1 deletion ml-proto/test/unreachable.wast
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
(block i32 (br_if 0 (unreachable) (i32.const 1)) (i32.const 7))
)
(func (export "as-br_if-value-cond") (result i32)
(block i32 (br_if 0 (i32.const 6) (unreachable)) (i32.const 7))
(block i32 (drop (br_if 0 (i32.const 6) (unreachable))) (i32.const 7))
)

(func (export "as-br_table-index")
Expand Down