From 3da8b08ecd57f5662bebc69ea73bf59e1928341e Mon Sep 17 00:00:00 2001 From: Abbas Mashayekh Date: Wed, 10 Feb 2021 01:17:28 +0330 Subject: [reference-types] remove single table restriction in IR (#3517) Adds support for modules with multiple tables. Adds a field for the table name to `CallIndirect` and updates the C/JS APIs accordingly. --- test/example/c-api-multiple-tables.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/example/c-api-multiple-tables.txt (limited to 'test/example/c-api-multiple-tables.txt') diff --git a/test/example/c-api-multiple-tables.txt b/test/example/c-api-multiple-tables.txt new file mode 100644 index 000000000..c0f2da53b --- /dev/null +++ b/test/example/c-api-multiple-tables.txt @@ -0,0 +1,20 @@ +(module + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (table $tab 1 1 funcref) + (elem (table $tab) (i32.const 0) func $adder) + (table $t2 1 1 funcref) + (elem (table $t2) (i32.const 0) func $adder) + (func $adder (param $0 i32) (param $1 i32) (result i32) + (i32.add + (local.get $0) + (local.get $1) + ) + ) + (func $call_adder_indirect (param $0 i32) (param $1 i32) (result i32) + (call_indirect $t2 (type $i32_i32_=>_i32) + (local.get $0) + (local.get $1) + (i32.const 0) + ) + ) +) -- cgit v1.2.3