diff options
Diffstat (limited to 'test/example/c-api-kitchen-sink.c')
-rw-r--r-- | test/example/c-api-kitchen-sink.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c index 5db1d28dc..894fc1454 100644 --- a/test/example/c-api-kitchen-sink.c +++ b/test/example/c-api-kitchen-sink.c @@ -1012,6 +1012,20 @@ void test_core() { BinaryenAddPassiveElementSegment(module, "p2", funcNames, 1); BinaryenRemoveElementSegment(module, "p2"); + BinaryenExpressionRef funcrefExpr1 = + BinaryenRefFunc(module, "kitchen()sinker", BinaryenTypeFuncref()); + + BinaryenExpressionPrint(BinaryenTableSet( + module, "0", BinaryenConst(module, BinaryenLiteralInt32(0)), funcrefExpr1)); + + BinaryenExpressionRef funcrefExpr2 = + BinaryenTableGet(module, + "0", + BinaryenConst(module, BinaryenLiteralInt32(0)), + BinaryenTypeFuncref()); + + BinaryenExpressionPrint(funcrefExpr2); + // Memory. One per module const char* segments[] = {"hello, world", "I am passive"}; |