Skip to content

Commit

Permalink
Merge pull request #116 from fitzgen/test-return-call-more-results
Browse files Browse the repository at this point in the history
Test `return_call*`s to callees that return more values than the caller does
  • Loading branch information
rossberg authored May 29, 2024
2 parents 8475cff + 013cf5d commit 9660b28
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
10 changes: 9 additions & 1 deletion test/core/return_call.wast
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,15 @@
)
"type mismatch"
)

(assert_invalid
(module
(func $f (result i32 i32) unreachable)
(func (result i32)
return_call $f
)
)
"type mismatch"
)

;; Unbound function

Expand Down
12 changes: 11 additions & 1 deletion test/core/return_call_indirect.wast
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,17 @@
)
"type mismatch"
)

(assert_invalid
(module
(type $ty (func (result i32 i32)))
(import "env" "table" (table $table 0 funcref))
(func (param i32) (result i32)
local.get 0
return_call_indirect $table (type $ty)
)
)
"type mismatch"
)

;; Unbound type

Expand Down
11 changes: 11 additions & 0 deletions test/core/return_call_ref.wast
Original file line number Diff line number Diff line change
Expand Up @@ -374,3 +374,14 @@
)
"type mismatch"
)

(assert_invalid
(module
(type $ty (func (result i32 i32)))
(func (param funcref) (result i32)
local.get 0
return_call_ref $ty
)
)
"type mismatch"
)

0 comments on commit 9660b28

Please sign in to comment.