From d7f6c02c78fb2ebf2092c3ccce21ae73f25a02bc Mon Sep 17 00:00:00 2001 From: RaoNikitha Date: Fri, 4 Oct 2024 09:58:10 -0400 Subject: [PATCH] added tests for call indirect --- test/core/call_indirect.wast | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/core/call_indirect.wast b/test/core/call_indirect.wast index 79b8dc393e..74b5e8d2e8 100644 --- a/test/core/call_indirect.wast +++ b/test/core/call_indirect.wast @@ -990,6 +990,15 @@ "type mismatch" ) +;; call_indirect expects funcref type but receives externref +(assert_invalid + (module + (type (func)) + (table 10 externref) + (func $call-indirect (call_indirect (type 0) (i32.const 0))) + ) + "type mismatch" +) ;; Unbound type @@ -1008,6 +1017,20 @@ "unknown type" ) +;; pass very large number to call_indirect +(assert_invalid + (module + (type (func (param i32))) + (table 1 funcref) + (func $conditional-dangling-type + (if (i32.const 1) + (then (call_indirect (type 0xffffffff) (i32.const 0))) + ) + ) + ) + "unknown type" +) + ;; Unbound function in table