summaryrefslogtreecommitdiff
path: root/test/example/c-api-kitchen-sink.c
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-kitchen-sink.c
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-kitchen-sink.c')
-rw-r--r--test/example/c-api-kitchen-sink.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index 907ab58c9..b45039c69 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -318,6 +318,8 @@ void test_core() {
BinaryenAddEvent(
module, "a-event", 0, BinaryenTypeInt32(), BinaryenTypeNone());
+ BinaryenAddTable(module, "tab", 0, 100, NULL, 0, makeInt32(module, 0));
+
// Exception handling
// (try
@@ -680,6 +682,7 @@ void test_core() {
BinaryenUnary(module,
BinaryenEqZInt32(), // check the output type of the call node
BinaryenCallIndirect(module,
+ "tab",
makeInt32(module, 2449),
callOperands4b,
4,
@@ -704,6 +707,7 @@ void test_core() {
BinaryenReturnCall(
module, "kitchen()sinker", callOperands4, 4, BinaryenTypeInt32()),
BinaryenReturnCallIndirect(module,
+ "tab",
makeInt32(module, 2449),
callOperands4b,
4,
@@ -840,6 +844,7 @@ void test_core() {
void test_unreachable() {
BinaryenModuleRef module = BinaryenModuleCreate();
BinaryenExpressionRef body = BinaryenCallIndirect(module,
+ "invalid-table",
BinaryenUnreachable(module),
NULL,
0,