From c5de1f5bbef142f56c8c329c315d5a3776322295 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Fri, 14 Jan 2022 16:17:42 -0800 Subject: Fix wat parsing of function imports with type name + inline type (#1808) This simplifies the code for parsing imported functions and makes it match more closely the code for parsing non-imported functions. Fixes: #1806 --- test/parse/module/import-func.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'test/parse') diff --git a/test/parse/module/import-func.txt b/test/parse/module/import-func.txt index 79b525f9..d71784ef 100644 --- a/test/parse/module/import-func.txt +++ b/test/parse/module/import-func.txt @@ -1,5 +1,7 @@ ;;; TOOL: wat2wasm (module + (type $add_type (func (param i32 i32) (result i32))) + ;; unnamed (import "foo" "bar" (func (param i32) (result i64))) @@ -8,4 +10,11 @@ (import "math" "add" (func $add_i32 (param i32 i32) (result i32))) (import "test" "f32" (func $f32 (param f32) (result f32))) (import "test" "f64" (func $f64 (param f64) (result f64))) - (import "test" "i64" (func $i64 (param i64) (result i64)))) + (import "test" "i64" (func $i64 (param i64) (result i64))) + + ;; named type + (import "math" "add" (func $add_i32_2 (type $add_type))) + + ;; named type, with repetition of type inline + (import "math" "add" (func $add_i32_3 (type $add_type) (param i32 i32) (result i32))) +) -- cgit v1.2.3