summaryrefslogtreecommitdiff
path: root/test/example/c-api-multiple-tables.txt
diff options
context:
space:
mode:
authorAbbas Mashayekh <martianboy2005@gmail.com>2021-02-10 01:17:28 +0330
committerGitHub <noreply@github.com>2021-02-09 13:47:28 -0800
commit3da8b08ecd57f5662bebc69ea73bf59e1928341e (patch)
tree2902eedc161579eaf37a1aed463de95916eee703 /test/example/c-api-multiple-tables.txt
parenta12a8250da24aa5b5787bf89562b243fdc514302 (diff)
downloadbinaryen-3da8b08ecd57f5662bebc69ea73bf59e1928341e.tar.gz
binaryen-3da8b08ecd57f5662bebc69ea73bf59e1928341e.tar.bz2
binaryen-3da8b08ecd57f5662bebc69ea73bf59e1928341e.zip
[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.
Diffstat (limited to 'test/example/c-api-multiple-tables.txt')
-rw-r--r--test/example/c-api-multiple-tables.txt20
1 files changed, 20 insertions, 0 deletions
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)
+ )
+ )
+)