summaryrefslogtreecommitdiff
path: root/test/example
diff options
context:
space:
mode:
Diffstat (limited to 'test/example')
-rw-r--r--test/example/c-api-kitchen-sink.c2
-rw-r--r--test/example/c-api-kitchen-sink.txt17
-rw-r--r--test/example/c-api-kitchen-sink.txt.txt5
3 files changed, 11 insertions, 13 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index 496ac4efd..0aaf5ab95 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -246,7 +246,7 @@ void test_core() {
// Memory. One per module
const char *segments[] = { "hello, world" };
- BinaryenIndex segmentOffsets[] = { 10 };
+ BinaryenExpressionRef segmentOffsets[] = { BinaryenConst(module, BinaryenLiteralInt32(10)) };
BinaryenIndex segmentSizes[] = { 12 };
BinaryenSetMemory(module, 1, 256, "mem", segments, segmentOffsets, segmentSizes, 1);
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index 64f5fc3b4..c8f123bdd 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -7,9 +7,8 @@ BinaryenFloat64: 4
(f32.const -33.61199951171875)
)
(module
- (memory 1 256
- (segment 10 "hello, world")
- )
+ (memory 1 256)
+ (data (i32.const 10) "hello, world")
(export "mem" memory)
(start $starter)
(type $iiIfF (func (param i32 i64 f32 f64) (result i32)))
@@ -1375,10 +1374,11 @@ int main() {
BinaryenFunctionRef funcs[] = { functions[0] };
BinaryenSetFunctionTable(the_module, funcs, 1);
}
+ expressions[245] = BinaryenConst(the_module, BinaryenLiteralInt32(10));
{
const char segment0[] = { 104, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100 };
const char* segments[] = { segment0 };
- BinaryenIndex segmentOffsets[] = { 10 };
+ BinaryenExpressionRef segmentOffsets[] = { expressions[245] };
BinaryenIndex segmentSizes[] = { 12 };
BinaryenSetMemory(the_module, 1, 256, "mem", segments, segmentOffsets, segmentSizes, 1);
}
@@ -1386,10 +1386,10 @@ int main() {
BinaryenIndex paramTypes[] = { 0 };
functionTypes[2] = BinaryenAddFunctionType(the_module, "v", 0, paramTypes, 0);
}
- expressions[245] = BinaryenNop(the_module);
+ expressions[246] = BinaryenNop(the_module);
{
BinaryenType varTypes[] = { 0 };
- functions[1] = BinaryenAddFunction(the_module, "starter", functionTypes[2], varTypes, 0, expressions[245]);
+ functions[1] = BinaryenAddFunction(the_module, "starter", functionTypes[2], varTypes, 0, expressions[246]);
}
BinaryenSetStart(the_module, functions[1]);
{
@@ -1399,9 +1399,8 @@ int main() {
BinaryenModuleValidate(the_module);
BinaryenModulePrint(the_module);
(module
- (memory 1 256
- (segment 10 "hello, world")
- )
+ (memory 1 256)
+ (data (i32.const 10) "hello, world")
(export "mem" memory)
(start $starter)
(type $iiIfF (func (param i32 i64 f32 f64) (result i32)))
diff --git a/test/example/c-api-kitchen-sink.txt.txt b/test/example/c-api-kitchen-sink.txt.txt
index 96cbaaa00..24dcc8a5c 100644
--- a/test/example/c-api-kitchen-sink.txt.txt
+++ b/test/example/c-api-kitchen-sink.txt.txt
@@ -2,9 +2,8 @@
(f32.const -33.61199951171875)
)
(module
- (memory 1 256
- (segment 10 "hello, world")
- )
+ (memory 1 256)
+ (data (i32.const 10) "hello, world")
(export "mem" memory)
(start $starter)
(type $iiIfF (func (param i32 i64 f32 f64) (result i32)))