summaryrefslogtreecommitdiff
path: root/test/example/c-api-kitchen-sink.c
diff options
context:
space:
mode:
authorDaniel Wirtz <dcode@dcode.io>2017-11-22 18:35:45 +0100
committerAlon Zakai <alonzakai@gmail.com>2017-11-22 09:35:45 -0800
commit94cbe63149248e251580ef95a6d3a31faf00a238 (patch)
treeafce67e1b95f29eccac259f156185e982d6e3bb0 /test/example/c-api-kitchen-sink.c
parent13ec76dfbc1c72a5e77d6a33fca5bf349308162d (diff)
downloadbinaryen-94cbe63149248e251580ef95a6d3a31faf00a238.tar.gz
binaryen-94cbe63149248e251580ef95a6d3a31faf00a238.tar.bz2
binaryen-94cbe63149248e251580ef95a6d3a31faf00a238.zip
Provide AddImport/AddExport for each element in the C-API (#1292)
* Provide AddImport/AddExport for each element in the C-API
Diffstat (limited to 'test/example/c-api-kitchen-sink.c')
-rw-r--r--test/example/c-api-kitchen-sink.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index 3b711d28a..496240437 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -234,9 +234,9 @@ void test_core() {
// Create the function
BinaryenType localTypes[] = { BinaryenInt32() };
BinaryenFunctionRef sinker = BinaryenAddFunction(module, "kitchen()sinker", iiIfF, localTypes, 1, body);
-
+
// Globals
-
+
BinaryenAddGlobal(module, "a-global", BinaryenInt32(), 0, makeInt32(module, 7));
BinaryenAddGlobal(module, "a-mutable-global", BinaryenFloat32(), 1, makeFloat32(module, 7.5));
@@ -244,11 +244,11 @@ void test_core() {
BinaryenType iparams[2] = { BinaryenInt32(), BinaryenFloat64() };
BinaryenFunctionTypeRef fiF = BinaryenAddFunctionType(module, "fiF", BinaryenFloat32(), iparams, 2);
- BinaryenAddImport(module, "an-imported", "module", "base", fiF);
+ BinaryenAddFunctionImport(module, "an-imported", "module", "base", fiF);
// Exports
- BinaryenAddExport(module, "kitchen()sinker", "kitchen_sinker");
+ BinaryenAddFunctionExport(module, "kitchen()sinker", "kitchen_sinker");
// Function table. One per module
BinaryenFunctionRef functions[] = { sinker };
@@ -310,7 +310,7 @@ void test_relooper() {
{
BinaryenType iparams[1] = { BinaryenInt32() };
BinaryenFunctionTypeRef vi = BinaryenAddFunctionType(module, "vi", BinaryenNone(), iparams, 1);
- BinaryenAddImport(module, "check", "module", "check", vi);
+ BinaryenAddFunctionImport(module, "check", "module", "check", vi);
}
{ // trivial: just one block
@@ -535,7 +535,7 @@ void test_interpret() {
BinaryenType iparams[2] = { BinaryenInt32() };
BinaryenFunctionTypeRef vi = BinaryenAddFunctionType(module, "vi", BinaryenNone(), iparams, 1);
- BinaryenAddImport(module, "print-i32", "spectest", "print", vi);
+ BinaryenAddFunctionImport(module, "print-i32", "spectest", "print", vi);
BinaryenFunctionTypeRef v = BinaryenAddFunctionType(module, "v", BinaryenNone(), NULL, 0);
BinaryenExpressionRef callOperands[] = { makeInt32(module, 1234) };