summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/binaryen.js/call_import_error.js4
-rw-r--r--test/binaryen.js/emit_asmjs.js2
-rw-r--r--test/binaryen.js/hello-world.js2
-rw-r--r--test/binaryen.js/kitchen-sink.js8
-rw-r--r--test/binaryen.js/kitchen-sink.js.txt6
-rw-r--r--test/example/c-api-kitchen-sink.c12
-rw-r--r--test/example/c-api-kitchen-sink.txt6
-rw-r--r--test/example/c-api-relooper-unreachable-if.cpp28
-rw-r--r--test/example/c-api-unused-mem.cpp4
-rw-r--r--test/example/relooper-fuzz.c2
-rw-r--r--test/example/relooper-fuzz1.c2
11 files changed, 38 insertions, 38 deletions
diff --git a/test/binaryen.js/call_import_error.js b/test/binaryen.js/call_import_error.js
index 4434584b5..22d1c38dd 100644
--- a/test/binaryen.js/call_import_error.js
+++ b/test/binaryen.js/call_import_error.js
@@ -1,12 +1,12 @@
var module = new Binaryen.Module();
var signature = module.addFunctionType("v", Binaryen.none, []);
-module.addImport("fn", "env", "fn", signature);
+module.addFunctionImport("fn", "env", "fn", signature);
module.addFunction("main", signature, [], module.block("", [
module.call("fn", [], Binaryen.none) // should be callImport
]));
-module.addExport("main", "main");
+module.addFunctionExport("main", "main");
console.log(module.emitText());
diff --git a/test/binaryen.js/emit_asmjs.js b/test/binaryen.js/emit_asmjs.js
index 6848f5f01..c7cd5c717 100644
--- a/test/binaryen.js/emit_asmjs.js
+++ b/test/binaryen.js/emit_asmjs.js
@@ -4,7 +4,7 @@ var signature = module.addFunctionType("ii", Binaryen.i32, [ Binaryen.i32 ]);
module.addFunction("main", signature, [], module.getLocal(0, Binaryen.i32));
-module.addExport("main", "main");
+module.addFunctionExport("main", "main");
module.validate(); // should validate before calling emitAsmjs
diff --git a/test/binaryen.js/hello-world.js b/test/binaryen.js/hello-world.js
index c08e67342..1cc5b89b7 100644
--- a/test/binaryen.js/hello-world.js
+++ b/test/binaryen.js/hello-world.js
@@ -22,7 +22,7 @@ module.addFunction('adder', iii, [], ret);
// Export the function, so we can call it later (for simplicity we
// export it as the same name as it has internally)
-module.addExport('adder', 'adder');
+module.addFunctionExport('adder', 'adder');
// Print out the text
console.log(module.emitText());
diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js
index 3205de702..2aa76eeab 100644
--- a/test/binaryen.js/kitchen-sink.js
+++ b/test/binaryen.js/kitchen-sink.js
@@ -230,11 +230,11 @@ function test_core() {
// Imports
var fiF = module.addFunctionType("fiF", Binaryen.f32, [ Binaryen.i32, Binaryen.f64 ]);
- module.addImport("an-imported", "module", "base", fiF);
+ module.addFunctionImport("an-imported", "module", "base", fiF);
// Exports
- module.addExport("kitchen()sinker", "kitchen_sinker");
+ module.addFunctionExport("kitchen()sinker", "kitchen_sinker");
// Function table. One per module
@@ -281,7 +281,7 @@ function test_relooper() {
{
var vi = module.addFunctionType("vi", Binaryen.None, [ Binaryen.i32 ]);
- module.addImport("check", "module", "check", vi);
+ module.addFunctionImport("check", "module", "check", vi);
}
{ // trivial: just one block
@@ -501,7 +501,7 @@ function test_interpret() {
module = new Binaryen.Module();
var vi = module.addFunctionType("vi", Binaryen.None, [ Binaryen.i32 ]);
- module.addImport("print-i32", "spectest", "print", vi);
+ module.addFunctionImport("print-i32", "spectest", "print", vi);
var v = module.addFunctionType("v", Binaryen.None, []);
call = module.callImport("print-i32", [ makeInt32(1234) ], Binaryen.None);
diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt
index f585d28d8..ed411bb87 100644
--- a/test/binaryen.js/kitchen-sink.js.txt
+++ b/test/binaryen.js/kitchen-sink.js.txt
@@ -1432,8 +1432,8 @@ getExpressionType=3
BinaryenType paramTypes[] = { 1, 4 };
functionTypes[1] = BinaryenAddFunctionType(the_module, "fiF", 3, paramTypes, 2);
}
- BinaryenAddImport(the_module, "an-imported", "module", "base", functionTypes[1]);
- BinaryenAddExport(the_module, "kitchen()sinker", "kitchen_sinker");
+ BinaryenAddFunctionImport(the_module, "an-imported", "module", "base", functionTypes[1]);
+ BinaryenAddFunctionExport(the_module, "kitchen()sinker", "kitchen_sinker");
{
BinaryenFunctionRef funcs[] = { functions[0] };
BinaryenSetFunctionTable(the_module, funcs, 1);
@@ -2009,7 +2009,7 @@ getExpressionType=3
BinaryenType paramTypes[] = { 1 };
functionTypes[1] = BinaryenAddFunctionType(the_module, "vi", 0, paramTypes, 1);
}
- BinaryenAddImport(the_module, "check", "module", "check", functionTypes[1]);
+ BinaryenAddFunctionImport(the_module, "check", "module", "check", functionTypes[1]);
the_relooper = RelooperCreate();
expressions[1] = BinaryenConst(the_module, BinaryenLiteralInt32(1337));
{
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) };
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index f33be1abd..c4e126079 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -1396,8 +1396,8 @@ int main() {
BinaryenType paramTypes[] = { 1, 4 };
functionTypes[1] = BinaryenAddFunctionType(the_module, "fiF", 3, paramTypes, 2);
}
- BinaryenAddImport(the_module, "an-imported", "module", "base", functionTypes[1]);
- BinaryenAddExport(the_module, "kitchen()sinker", "kitchen_sinker");
+ BinaryenAddFunctionImport(the_module, "an-imported", "module", "base", functionTypes[1]);
+ BinaryenAddFunctionExport(the_module, "kitchen()sinker", "kitchen_sinker");
{
BinaryenFunctionRef funcs[] = { functions[0] };
BinaryenSetFunctionTable(the_module, funcs, 1);
@@ -1974,7 +1974,7 @@ int main() {
BinaryenType paramTypes[] = { 1 };
functionTypes[1] = BinaryenAddFunctionType(the_module, "vi", 0, paramTypes, 1);
}
- BinaryenAddImport(the_module, "check", "module", "check", functionTypes[1]);
+ BinaryenAddFunctionImport(the_module, "check", "module", "check", functionTypes[1]);
the_relooper = RelooperCreate();
expressions[1] = BinaryenConst(the_module, BinaryenLiteralInt32(1337));
{
diff --git a/test/example/c-api-relooper-unreachable-if.cpp b/test/example/c-api-relooper-unreachable-if.cpp
index b6f7f8b04..ddb9e5ac9 100644
--- a/test/example/c-api-relooper-unreachable-if.cpp
+++ b/test/example/c-api-relooper-unreachable-if.cpp
@@ -42,7 +42,7 @@ int main() {
BinaryenType varTypes[] = { 1, 1, 2 };
functions[0] = BinaryenAddFunction(the_module, "tinycore::eh_personality", functionTypes[0], varTypes, 3, expressions[9]);
}
- BinaryenAddExport(the_module, "tinycore::eh_personality", "tinycore::eh_personality");
+ BinaryenAddFunctionExport(the_module, "tinycore::eh_personality", "tinycore::eh_personality");
the_relooper = RelooperCreate();
expressions[10] = BinaryenGetLocal(the_module, 0, 1);
expressions[11] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
@@ -63,7 +63,7 @@ int main() {
BinaryenType varTypes[] = { 1, 1, 2 };
functions[1] = BinaryenAddFunction(the_module, "tinycore::eh_unwind_resume", functionTypes[0], varTypes, 3, expressions[18]);
}
- BinaryenAddExport(the_module, "tinycore::eh_unwind_resume", "tinycore::eh_unwind_resume");
+ BinaryenAddFunctionExport(the_module, "tinycore::eh_unwind_resume", "tinycore::eh_unwind_resume");
the_relooper = RelooperCreate();
{
BinaryenExpressionRef children[] = { 0 };
@@ -91,7 +91,7 @@ int main() {
BinaryenType varTypes[] = { 1, 1, 2 };
functions[2] = BinaryenAddFunction(the_module, "tinycore::panic_fmt", functionTypes[1], varTypes, 3, expressions[24]);
}
- BinaryenAddExport(the_module, "tinycore::panic_fmt", "tinycore::panic_fmt");
+ BinaryenAddFunctionExport(the_module, "tinycore::panic_fmt", "tinycore::panic_fmt");
the_relooper = RelooperCreate();
expressions[25] = BinaryenGetLocal(the_module, 0, 1);
expressions[26] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
@@ -112,7 +112,7 @@ int main() {
BinaryenType varTypes[] = { 1, 1, 2 };
functions[3] = BinaryenAddFunction(the_module, "tinycore::rust_eh_register_frames", functionTypes[0], varTypes, 3, expressions[33]);
}
- BinaryenAddExport(the_module, "tinycore::rust_eh_register_frames", "tinycore::rust_eh_register_frames");
+ BinaryenAddFunctionExport(the_module, "tinycore::rust_eh_register_frames", "tinycore::rust_eh_register_frames");
the_relooper = RelooperCreate();
expressions[34] = BinaryenGetLocal(the_module, 0, 1);
expressions[35] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
@@ -133,7 +133,7 @@ int main() {
BinaryenType varTypes[] = { 1, 1, 2 };
functions[4] = BinaryenAddFunction(the_module, "tinycore::rust_eh_unregister_frames", functionTypes[0], varTypes, 3, expressions[42]);
}
- BinaryenAddExport(the_module, "tinycore::rust_eh_unregister_frames", "tinycore::rust_eh_unregister_frames");
+ BinaryenAddFunctionExport(the_module, "tinycore::rust_eh_unregister_frames", "tinycore::rust_eh_unregister_frames");
the_relooper = RelooperCreate();
expressions[43] = BinaryenGetLocal(the_module, 0, 1);
expressions[44] = BinaryenSetLocal(the_module, 1, expressions[43]);
@@ -143,7 +143,7 @@ int main() {
BinaryenType paramTypes[] = { 1 };
functionTypes[2] = BinaryenAddFunctionType(the_module, "print_i32", 0, paramTypes, 1);
}
- BinaryenAddImport(the_module, "print_i32", "spectest", "print", functionTypes[2]);
+ BinaryenAddFunctionImport(the_module, "print_i32", "spectest", "print", functionTypes[2]);
expressions[47] = BinaryenGetLocal(the_module, 2, 1);
{
BinaryenExpressionRef operands[] = { expressions[47] };
@@ -178,7 +178,7 @@ int main() {
BinaryenType varTypes[] = { 1, 1, 1, 1, 2 };
functions[5] = BinaryenAddFunction(the_module, "wasm::print_i32", functionTypes[3], varTypes, 5, expressions[58]);
}
- BinaryenAddExport(the_module, "wasm::print_i32", "wasm::print_i32");
+ BinaryenAddFunctionExport(the_module, "wasm::print_i32", "wasm::print_i32");
the_relooper = RelooperCreate();
expressions[59] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
expressions[60] = BinaryenSetLocal(the_module, 0, expressions[59]);
@@ -247,7 +247,7 @@ int main() {
BinaryenType varTypes[] = { 1, 1, 1, 1, 1, 1, 1, 1, 2 };
functions[6] = BinaryenAddFunction(the_module, "real_main", functionTypes[4], varTypes, 9, expressions[104]);
}
- BinaryenAddExport(the_module, "real_main", "real_main");
+ BinaryenAddFunctionExport(the_module, "real_main", "real_main");
the_relooper = RelooperCreate();
expressions[105] = BinaryenGetLocal(the_module, 0, 1);
expressions[106] = BinaryenSetLocal(the_module, 2, expressions[105]);
@@ -338,7 +338,7 @@ int main() {
BinaryenType varTypes[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 };
functions[7] = BinaryenAddFunction(the_module, "main", functionTypes[5], varTypes, 10, expressions[156]);
}
- BinaryenAddExport(the_module, "main", "main");
+ BinaryenAddFunctionExport(the_module, "main", "main");
{
BinaryenType paramTypes[] = { 0 };
functionTypes[6] = BinaryenAddFunctionType(the_module, "__wasm_start", 0, paramTypes, 0);
@@ -363,7 +363,7 @@ int main() {
BinaryenExpressionRef children[] = { expressions[159], expressions[163] };
expressions[164] = BinaryenBlock(the_module, NULL, children, 2, BinaryenUndefined());
}
- BinaryenAddExport(the_module, "__wasm_start", "rust_entry");
+ BinaryenAddFunctionExport(the_module, "__wasm_start", "rust_entry");
{
BinaryenType varTypes[] = { 0 };
functions[8] = BinaryenAddFunction(the_module, "__wasm_start", functionTypes[6], varTypes, 0, expressions[164]);
@@ -437,7 +437,7 @@ int main() {
BinaryenType varTypes[] = { 1, 1, 1, 1, 1, 1, 1, 1, 2 };
functions[9] = BinaryenAddFunction(the_module, "_isize_as_tinycore::Add_::add", functionTypes[7], varTypes, 9, expressions[210]);
}
- BinaryenAddExport(the_module, "_isize_as_tinycore::Add_::add", "_isize_as_tinycore::Add_::add");
+ BinaryenAddFunctionExport(the_module, "_isize_as_tinycore::Add_::add", "_isize_as_tinycore::Add_::add");
the_relooper = RelooperCreate();
expressions[211] = BinaryenGetLocal(the_module, 0, 1);
expressions[212] = BinaryenSetLocal(the_module, 1, expressions[211]);
@@ -470,7 +470,7 @@ int main() {
BinaryenType varTypes[] = { 1, 1, 1, 1, 1, 2 };
functions[10] = BinaryenAddFunction(the_module, "_bool_as_tinycore::Not_::not", functionTypes[8], varTypes, 6, expressions[227]);
}
- BinaryenAddExport(the_module, "_bool_as_tinycore::Not_::not", "_bool_as_tinycore::Not_::not");
+ BinaryenAddFunctionExport(the_module, "_bool_as_tinycore::Not_::not", "_bool_as_tinycore::Not_::not");
the_relooper = RelooperCreate();
expressions[228] = BinaryenGetLocal(the_module, 0, 1);
expressions[229] = BinaryenSetLocal(the_module, 2, expressions[228]);
@@ -508,7 +508,7 @@ int main() {
BinaryenType varTypes[] = { 1, 1, 1, 1, 1, 1, 1, 2 };
functions[11] = BinaryenAddFunction(the_module, "_i16_as_tinycore::PartialEq_::eq", functionTypes[9], varTypes, 8, expressions[249]);
}
- BinaryenAddExport(the_module, "_i16_as_tinycore::PartialEq_::eq", "_i16_as_tinycore::PartialEq_::eq");
+ BinaryenAddFunctionExport(the_module, "_i16_as_tinycore::PartialEq_::eq", "_i16_as_tinycore::PartialEq_::eq");
the_relooper = RelooperCreate();
expressions[250] = BinaryenGetLocal(the_module, 0, 1);
expressions[251] = BinaryenSetLocal(the_module, 2, expressions[250]);
@@ -546,7 +546,7 @@ int main() {
BinaryenType varTypes[] = { 1, 1, 2, 2, 1, 1, 1, 2 };
functions[12] = BinaryenAddFunction(the_module, "_i64_as_tinycore::PartialEq_::eq", functionTypes[10], varTypes, 8, expressions[271]);
}
- BinaryenAddExport(the_module, "_i64_as_tinycore::PartialEq_::eq", "_i64_as_tinycore::PartialEq_::eq");
+ BinaryenAddFunctionExport(the_module, "_i64_as_tinycore::PartialEq_::eq", "_i64_as_tinycore::PartialEq_::eq");
BinaryenModuleValidate(the_module);
BinaryenModuleDispose(the_module);
functionTypes.clear();
diff --git a/test/example/c-api-unused-mem.cpp b/test/example/c-api-unused-mem.cpp
index a0de5637b..dccb371fc 100644
--- a/test/example/c-api-unused-mem.cpp
+++ b/test/example/c-api-unused-mem.cpp
@@ -49,7 +49,7 @@ int main() {
BinaryenType varTypes[] = { 1, 1, 2 };
functions[0] = BinaryenAddFunction(the_module, "main", functionTypes[0], varTypes, 3, expressions[10]);
}
- BinaryenAddExport(the_module, "main", "main");
+ BinaryenAddFunctionExport(the_module, "main", "main");
{
BinaryenType paramTypes[] = { 0 };
functionTypes[1] = BinaryenAddFunctionType(the_module, "__wasm_start", 0, paramTypes, 0);
@@ -71,7 +71,7 @@ int main() {
BinaryenExpressionRef children[] = { expressions[13], expressions[14] };
expressions[15] = BinaryenBlock(the_module, NULL, children, 2, BinaryenUndefined());
}
- BinaryenAddExport(the_module, "__wasm_start", "rust_entry");
+ BinaryenAddFunctionExport(the_module, "__wasm_start", "rust_entry");
{
BinaryenType varTypes[] = { 0 };
functions[1] = BinaryenAddFunction(the_module, "__wasm_start", functionTypes[1], varTypes, 0, expressions[15]);
diff --git a/test/example/relooper-fuzz.c b/test/example/relooper-fuzz.c
index d813c76a9..11e25d19c 100644
--- a/test/example/relooper-fuzz.c
+++ b/test/example/relooper-fuzz.c
@@ -253,7 +253,7 @@ int main() {
BinaryenType iparams[] = { BinaryenInt32() };
BinaryenFunctionTypeRef vi = BinaryenAddFunctionType(module, "vi", BinaryenNone(), iparams, 1);
- BinaryenAddImport(module, "print", "spectest", "print", vi);
+ BinaryenAddFunctionImport(module, "print", "spectest", "print", vi);
// memory
BinaryenSetMemory(module, 1, 1, "mem", NULL, NULL, NULL, 0);
diff --git a/test/example/relooper-fuzz1.c b/test/example/relooper-fuzz1.c
index 4293044f2..676c9b8f4 100644
--- a/test/example/relooper-fuzz1.c
+++ b/test/example/relooper-fuzz1.c
@@ -325,7 +325,7 @@ int main() {
BinaryenFunctionTypeRef vi = BinaryenAddFunctionType(module, "vi",
BinaryenNone(),
iparams, 1);
- BinaryenAddImport(module, "print", "spectest", "print", vi);
+ BinaryenAddFunctionImport(module, "print", "spectest", "print", vi);
// memory
BinaryenSetMemory(module, 1, 1, "mem", NULL, NULL, NULL, 0);