summaryrefslogtreecommitdiff
path: root/test/example/c-api-unused-mem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/example/c-api-unused-mem.cpp')
-rw-r--r--test/example/c-api-unused-mem.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/test/example/c-api-unused-mem.cpp b/test/example/c-api-unused-mem.cpp
index d625e2b51..03a6746f7 100644
--- a/test/example/c-api-unused-mem.cpp
+++ b/test/example/c-api-unused-mem.cpp
@@ -26,9 +26,10 @@ int main() {
expressions[1] = BinaryenBlock(the_module, "bb0", children, 0, BinaryenTypeAuto());
}
relooperBlocks[0] = RelooperAddBlock(the_relooper, expressions[1]);
- expressions[2] = BinaryenLocalGet(the_module, 0, 1);
+ expressions[2] = BinaryenLocalGet(the_module, 0, BinaryenTypeInt32());
expressions[3] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[4] = BinaryenStore(the_module, 4, 0, 0, expressions[3], expressions[2], 1);
+ expressions[4] = BinaryenStore(
+ the_module, 4, 0, 0, expressions[3], expressions[2], BinaryenTypeInt32());
expressions[5] = BinaryenReturn(the_module, expressions[0]);
{
BinaryenExpressionRef children[] = { expressions[4], expressions[5] };
@@ -37,22 +38,24 @@ int main() {
relooperBlocks[1] = RelooperAddBlock(the_relooper, expressions[6]);
RelooperAddBranch(relooperBlocks[0], relooperBlocks[1], expressions[0], expressions[0]);
{
- BinaryenType paramTypes[] = { 0 };
+ BinaryenType paramTypes[] = {BinaryenTypeNone()};
functionTypes[0] = BinaryenAddFunctionType(the_module, "rustfn-0-3", 0, paramTypes, 0);
}
expressions[7] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[8] = BinaryenLoad(the_module, 4, 0, 0, 0, 1, expressions[7]);
+ expressions[8] =
+ BinaryenLoad(the_module, 4, 0, 0, 0, BinaryenTypeInt32(), expressions[7]);
expressions[9] = BinaryenLocalSet(the_module, 0, expressions[8]);
relooperBlocks[2] = RelooperAddBlock(the_relooper, expressions[9]);
RelooperAddBranch(relooperBlocks[2], relooperBlocks[0], expressions[0], expressions[0]);
expressions[10] = RelooperRenderAndDispose(the_relooper, relooperBlocks[2], 1);
{
- BinaryenType varTypes[] = { 1, 1, 2 };
+ BinaryenType varTypes[] = {
+ BinaryenTypeInt32(), BinaryenTypeInt32(), BinaryenTypeInt64()};
functions[0] = BinaryenAddFunction(the_module, "main", functionTypes[0], varTypes, 3, expressions[10]);
}
BinaryenAddFunctionExport(the_module, "main", "main");
{
- BinaryenType paramTypes[] = { 0 };
+ BinaryenType paramTypes[] = {BinaryenTypeNone()};
functionTypes[1] = BinaryenAddFunctionType(the_module, "__wasm_start", 0, paramTypes, 0);
}
{
@@ -64,7 +67,8 @@ int main() {
}
expressions[11] = BinaryenConst(the_module, BinaryenLiteralInt32(65535));
expressions[12] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[13] = BinaryenStore(the_module, 4, 0, 0, expressions[12], expressions[11], 1);
+ expressions[13] = BinaryenStore(
+ the_module, 4, 0, 0, expressions[12], expressions[11], BinaryenTypeInt32());
{
BinaryenExpressionRef operands[] = { 0 };
expressions[14] = BinaryenCall(the_module, "main", operands, 0, 0);
@@ -75,7 +79,7 @@ int main() {
}
BinaryenAddFunctionExport(the_module, "__wasm_start", "rust_entry");
{
- BinaryenType varTypes[] = { 0 };
+ BinaryenType varTypes[] = {BinaryenTypeNone()};
functions[1] = BinaryenAddFunction(the_module, "__wasm_start", functionTypes[1], varTypes, 0, expressions[15]);
}
BinaryenModuleValidate(the_module);