summaryrefslogtreecommitdiff
path: root/test/example
diff options
context:
space:
mode:
Diffstat (limited to 'test/example')
-rw-r--r--test/example/c-api-kitchen-sink.c9
-rw-r--r--test/example/c-api-kitchen-sink.txt12
-rw-r--r--test/example/c-api-kitchen-sink.txt.txt1
-rw-r--r--test/example/c-api-relooper-unreachable-if.cpp7
-rw-r--r--test/example/c-api-unused-mem.cpp7
-rw-r--r--test/example/relooper-fuzz.c2
-rw-r--r--test/example/relooper-fuzz1.c2
-rw-r--r--test/example/relooper-fuzz2.c2
-rw-r--r--test/example/relooper-merge1.c2
-rw-r--r--test/example/relooper-merge2.c2
-rw-r--r--test/example/relooper-merge3.c2
-rw-r--r--test/example/relooper-merge4.c2
-rw-r--r--test/example/relooper-merge5.c2
-rw-r--r--test/example/relooper-merge6.c2
14 files changed, 31 insertions, 23 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index 244ecc9b5..66d7bee06 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -491,10 +491,11 @@ void test_core() {
// Memory. One per module
- const char* segments[] = { "hello, world" };
- BinaryenExpressionRef segmentOffsets[] = { BinaryenConst(module, BinaryenLiteralInt32(10)) };
- BinaryenIndex segmentSizes[] = { 12 };
- BinaryenSetMemory(module, 1, 256, "mem", segments, segmentOffsets, segmentSizes, 1, 0);
+ const char* segments[] = { "hello, world", "I am passive" };
+ int8_t segmentPassive[] = { 0, 1 };
+ BinaryenExpressionRef segmentOffsets[] = { BinaryenConst(module, BinaryenLiteralInt32(10)), NULL };
+ BinaryenIndex segmentSizes[] = { 12, 12 };
+ BinaryenSetMemory(module, 1, 256, "mem", segments, segmentPassive, segmentOffsets, segmentSizes, 2, 0);
// Start function. One per module
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index 0f8775092..df193c379 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -17,6 +17,7 @@ BinaryenTypeAuto: -1
(import "module" "base" (func $an-imported (param i32 f64) (result f32)))
(memory $0 1 256)
(data (i32.const 10) "hello, world")
+ (data passive "I am passive")
(table $0 1 1 funcref)
(elem (i32.const 0) "$kitchen()sinker")
(global $a-global i32 (i32.const 7))
@@ -3288,10 +3289,12 @@ int main() {
expressions[655] = BinaryenConst(the_module, BinaryenLiteralInt32(10));
{
const char segment0[] = { 104, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100 };
- const char* segments[] = { segment0 };
- BinaryenExpressionRef segmentOffsets[] = { expressions[655] };
- BinaryenIndex segmentSizes[] = { 12 };
- BinaryenSetMemory(the_module, 1, 256, "mem", segments, segmentOffsets, segmentSizes, 1, 0);
+ const char segment1[] = { 73, 32, 97, 109, 32, 112, 97, 115, 115, 105, 118, 101 };
+ const char* segments[] = { segment0, segment1 };
+ int8_t segmentPassive[] = { 0, 1 };
+ BinaryenExpressionRef segmentOffsets[] = { expressions[655], expressions[0] };
+ BinaryenIndex segmentSizes[] = { 12, 12 };
+ BinaryenSetMemory(the_module, 1, 256, "mem", segments, segmentPassive, segmentOffsets, segmentSizes, 2, 0);
}
{
BinaryenType paramTypes[] = { 0 };
@@ -3318,6 +3321,7 @@ int main() {
(import "module" "base" (func $an-imported (param i32 f64) (result f32)))
(memory $0 1 256)
(data (i32.const 10) "hello, world")
+ (data passive "I am passive")
(table $0 1 1 funcref)
(elem (i32.const 0) "$kitchen()sinker")
(global $a-global i32 (i32.const 7))
diff --git a/test/example/c-api-kitchen-sink.txt.txt b/test/example/c-api-kitchen-sink.txt.txt
index b7caa1bad..05edca1a2 100644
--- a/test/example/c-api-kitchen-sink.txt.txt
+++ b/test/example/c-api-kitchen-sink.txt.txt
@@ -9,6 +9,7 @@
(import "module" "base" (func $an-imported (param i32 f64) (result f32)))
(memory $0 1 256)
(data (i32.const 10) "hello, world")
+ (data passive "I am passive")
(table $0 1 1 funcref)
(elem (i32.const 0) "$kitchen()sinker")
(global $a-global i32 (i32.const 7))
diff --git a/test/example/c-api-relooper-unreachable-if.cpp b/test/example/c-api-relooper-unreachable-if.cpp
index cfd802b58..3acc65d56 100644
--- a/test/example/c-api-relooper-unreachable-if.cpp
+++ b/test/example/c-api-relooper-unreachable-if.cpp
@@ -14,9 +14,10 @@ int main() {
BinaryenModuleAutoDrop(the_module);
{
const char* segments[] = { 0 };
+ int8_t segmentPassive[] = { 0 };
BinaryenExpressionRef segmentOffsets[] = { 0 };
BinaryenIndex segmentSizes[] = { 0 };
- BinaryenSetMemory(the_module, 256, 256, "memory", segments, segmentOffsets, segmentSizes, 0, 0);
+ BinaryenSetMemory(the_module, 256, 256, "memory", segments, segmentPassive, segmentOffsets, segmentSizes, 0, 0);
}
the_relooper = RelooperCreate(the_module);
expressions[1] = BinaryenGetLocal(the_module, 0, 1);
@@ -346,8 +347,9 @@ int main() {
{
const char* segments[] = { 0 };
BinaryenExpressionRef segmentOffsets[] = { 0 };
+ int8_t segmentPassive[] = { 0 };
BinaryenIndex segmentSizes[] = { 0 };
- BinaryenSetMemory(the_module, 1, 1, NULL, segments, segmentOffsets, segmentSizes, 0, 0);
+ BinaryenSetMemory(the_module, 1, 1, NULL, segments, segmentPassive, segmentOffsets, segmentSizes, 0, 0);
}
expressions[157] = BinaryenConst(the_module, BinaryenLiteralInt32(65535));
expressions[158] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
@@ -554,4 +556,3 @@ int main() {
functions.clear();
relooperBlocks.clear();
}
-
diff --git a/test/example/c-api-unused-mem.cpp b/test/example/c-api-unused-mem.cpp
index 1c74b2dfd..49d116fdc 100644
--- a/test/example/c-api-unused-mem.cpp
+++ b/test/example/c-api-unused-mem.cpp
@@ -15,9 +15,10 @@ int main() {
BinaryenModuleAutoDrop(the_module);
{
const char* segments[] = { 0 };
+ int8_t segmentPassive[] = { 0 };
BinaryenExpressionRef segmentOffsets[] = { 0 };
BinaryenIndex segmentSizes[] = { 0 };
- BinaryenSetMemory(the_module, 256, 256, "memory", segments, segmentOffsets, segmentSizes, 0, 0);
+ BinaryenSetMemory(the_module, 256, 256, "memory", segments, segmentPassive, segmentOffsets, segmentSizes, 0, 0);
}
the_relooper = RelooperCreate(the_module);
{
@@ -56,9 +57,10 @@ int main() {
}
{
const char* segments[] = { 0 };
+ int8_t segmentPassive[] = { 0 };
BinaryenExpressionRef segmentOffsets[] = { 0 };
BinaryenIndex segmentSizes[] = { 0 };
- BinaryenSetMemory(the_module, 1024, 1024, NULL, segments, segmentOffsets, segmentSizes, 0, 0);
+ BinaryenSetMemory(the_module, 1024, 1024, NULL, segments, segmentPassive, segmentOffsets, segmentSizes, 0, 0);
}
expressions[11] = BinaryenConst(the_module, BinaryenLiteralInt32(65535));
expressions[12] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
@@ -91,4 +93,3 @@ int main() {
BinaryenModuleDispose(the_module);
return 0;
}
-
diff --git a/test/example/relooper-fuzz.c b/test/example/relooper-fuzz.c
index 606274683..7d8e5aec0 100644
--- a/test/example/relooper-fuzz.c
+++ b/test/example/relooper-fuzz.c
@@ -256,7 +256,7 @@ int main() {
BinaryenAddFunctionImport(module, "print", "spectest", "print", vi);
// memory
- BinaryenSetMemory(module, 1, 1, "mem", NULL, NULL, NULL, 0, 0);
+ BinaryenSetMemory(module, 1, 1, "mem", NULL, NULL, NULL, NULL, 0, 0);
assert(BinaryenModuleValidate(module));
diff --git a/test/example/relooper-fuzz1.c b/test/example/relooper-fuzz1.c
index 495f7c610..5b6b7f450 100644
--- a/test/example/relooper-fuzz1.c
+++ b/test/example/relooper-fuzz1.c
@@ -327,7 +327,7 @@ int main() {
BinaryenAddFunctionImport(module, "print", "spectest", "print", vi);
// memory
- BinaryenSetMemory(module, 1, 1, "mem", NULL, NULL, NULL, 0, 0);
+ BinaryenSetMemory(module, 1, 1, "mem", NULL, NULL, NULL, NULL, 0, 0);
assert(BinaryenModuleValidate(module));
diff --git a/test/example/relooper-fuzz2.c b/test/example/relooper-fuzz2.c
index ad687f918..66ffcef36 100644
--- a/test/example/relooper-fuzz2.c
+++ b/test/example/relooper-fuzz2.c
@@ -492,7 +492,7 @@ int main() {
BinaryenAddFunctionImport(module, "print", "spectest", "print", vi);
// memory
- BinaryenSetMemory(module, 1, 1, "mem", NULL, NULL, NULL, 0, 0);
+ BinaryenSetMemory(module, 1, 1, "mem", NULL, NULL, NULL, NULL, 0, 0);
// optionally, optimize
if (0) BinaryenModuleOptimize(module);
diff --git a/test/example/relooper-merge1.c b/test/example/relooper-merge1.c
index 9bcc403d5..df08e60b5 100644
--- a/test/example/relooper-merge1.c
+++ b/test/example/relooper-merge1.c
@@ -194,7 +194,7 @@ int main() {
BinaryenAddFunctionImport(module, "print", "spectest", "print", vi);
// memory
- BinaryenSetMemory(module, 1, 1, "mem", NULL, NULL, NULL, 0, 0);
+ BinaryenSetMemory(module, 1, 1, "mem", NULL, NULL, NULL, NULL, 0, 0);
// optionally, optimize
if (0) BinaryenModuleOptimize(module);
diff --git a/test/example/relooper-merge2.c b/test/example/relooper-merge2.c
index 852e75842..2784b4e71 100644
--- a/test/example/relooper-merge2.c
+++ b/test/example/relooper-merge2.c
@@ -206,7 +206,7 @@ int main() {
BinaryenAddFunctionImport(module, "print", "spectest", "print", vi);
// memory
- BinaryenSetMemory(module, 1, 1, "mem", NULL, NULL, NULL, 0, 0);
+ BinaryenSetMemory(module, 1, 1, "mem", NULL, NULL, NULL, NULL, 0, 0);
// optionally, optimize
if (0) BinaryenModuleOptimize(module);
diff --git a/test/example/relooper-merge3.c b/test/example/relooper-merge3.c
index 09cb98138..a992c0d47 100644
--- a/test/example/relooper-merge3.c
+++ b/test/example/relooper-merge3.c
@@ -193,7 +193,7 @@ int main() {
BinaryenAddFunctionImport(module, "print", "spectest", "print", vi);
// memory
- BinaryenSetMemory(module, 1, 1, "mem", NULL, NULL, NULL, 0, 0);
+ BinaryenSetMemory(module, 1, 1, "mem", NULL, NULL, NULL, NULL, 0, 0);
// optionally, optimize
if (0) BinaryenModuleOptimize(module);
diff --git a/test/example/relooper-merge4.c b/test/example/relooper-merge4.c
index 41e094315..d8d78d082 100644
--- a/test/example/relooper-merge4.c
+++ b/test/example/relooper-merge4.c
@@ -193,7 +193,7 @@ int main() {
BinaryenAddFunctionImport(module, "print", "spectest", "print", vi);
// memory
- BinaryenSetMemory(module, 1, 1, "mem", NULL, NULL, NULL, 0, 0);
+ BinaryenSetMemory(module, 1, 1, "mem", NULL, NULL, NULL, NULL, 0, 0);
// optionally, optimize
if (0) BinaryenModuleOptimize(module);
diff --git a/test/example/relooper-merge5.c b/test/example/relooper-merge5.c
index 153ce963a..8c4c25ad0 100644
--- a/test/example/relooper-merge5.c
+++ b/test/example/relooper-merge5.c
@@ -193,7 +193,7 @@ int main() {
BinaryenAddFunctionImport(module, "print", "spectest", "print", vi);
// memory
- BinaryenSetMemory(module, 1, 1, "mem", NULL, NULL, NULL, 0, 0);
+ BinaryenSetMemory(module, 1, 1, "mem", NULL, NULL, NULL, NULL, 0, 0);
// optionally, optimize
if (0) BinaryenModuleOptimize(module);
diff --git a/test/example/relooper-merge6.c b/test/example/relooper-merge6.c
index 25004c9df..7576a6c1e 100644
--- a/test/example/relooper-merge6.c
+++ b/test/example/relooper-merge6.c
@@ -184,7 +184,7 @@ int main() {
BinaryenAddFunctionImport(module, "print", "spectest", "print", vi);
// memory
- BinaryenSetMemory(module, 1, 1, "mem", NULL, NULL, NULL, 0, 0);
+ BinaryenSetMemory(module, 1, 1, "mem", NULL, NULL, NULL, NULL, 0, 0);
// optionally, optimize
if (0) BinaryenModuleOptimize(module);