diff --git a/test/core/return_call.wast b/test/core/return_call.wast index 2f91f4deac..b9e8f8f010 100644 --- a/test/core/return_call.wast +++ b/test/core/return_call.wast @@ -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 diff --git a/test/core/return_call_indirect.wast b/test/core/return_call_indirect.wast index acf0a72e06..aa158be256 100644 --- a/test/core/return_call_indirect.wast +++ b/test/core/return_call_indirect.wast @@ -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 diff --git a/test/core/return_call_ref.wast b/test/core/return_call_ref.wast index 2b495f46e9..327dc84b89 100644 --- a/test/core/return_call_ref.wast +++ b/test/core/return_call_ref.wast @@ -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" +)