summaryrefslogtreecommitdiff
path: root/test/example/c-api-multiple-tables.c
diff options
context:
space:
mode:
authorKinderGartenKiller <33396195+mobsceneZ@users.noreply.github.com>2023-11-30 08:28:11 +0800
committerGitHub <noreply@github.com>2023-11-30 00:28:11 +0000
commit24742589f5471a5e72755d8fe1da9e49923a35ff (patch)
tree5f0bd747b252b687d637ae20b4596352bc58c3ad /test/example/c-api-multiple-tables.c
parentdbcac17d645d8ace8ae2cb69d6ba36b22d59b7cf (diff)
downloadbinaryen-24742589f5471a5e72755d8fe1da9e49923a35ff.tar.gz
binaryen-24742589f5471a5e72755d8fe1da9e49923a35ff.tar.bz2
binaryen-24742589f5471a5e72755d8fe1da9e49923a35ff.zip
C API: Add BinaryenTableGetType and BinaryenTableSetType (#6137)
Fixes #6136
Diffstat (limited to 'test/example/c-api-multiple-tables.c')
-rw-r--r--test/example/c-api-multiple-tables.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/example/c-api-multiple-tables.c b/test/example/c-api-multiple-tables.c
index 7cd215bf9..4d1eefcfc 100644
--- a/test/example/c-api-multiple-tables.c
+++ b/test/example/c-api-multiple-tables.c
@@ -62,6 +62,11 @@ int main() {
assert(BinaryenElementSegmentGetLength(elem1) == 1);
assert(strcmp(BinaryenElementSegmentGetData(elem1, 0), funcNames[0]) == 0);
+ assert(BinaryenTableGetType(t2) == BinaryenTypeFuncref());
+ BinaryenTableSetType(t2, BinaryenTypeExternref());
+ assert(BinaryenTableGetType(t2) == BinaryenTypeExternref());
+ BinaryenTableSetType(t2, BinaryenTypeFuncref());
+
assert(strcmp(BinaryenTableGetName(t2), "t2") == 0);
BinaryenTableSetName(t2, "table2");
BinaryenModuleUpdateMaps(module);