diff options
Diffstat (limited to 'test/example')
-rw-r--r-- | test/example/c-api-kitchen-sink.c | 6 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 22 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt.txt | 3 | ||||
-rw-r--r-- | test/example/c-api-unused-mem.txt | 5 |
4 files changed, 13 insertions, 23 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c index 68d7e82ea..f438015b8 100644 --- a/test/example/c-api-kitchen-sink.c +++ b/test/example/c-api-kitchen-sink.c @@ -272,10 +272,8 @@ void test_core() { temp15 = makeInt32(module, 110), temp16 = makeInt64(module, 111); // Events - BinaryenType eparams[1] = {BinaryenTypeInt32()}; - BinaryenFunctionTypeRef vi = - BinaryenAddFunctionType(module, "vi", BinaryenTypeNone(), eparams, 1); - BinaryenAddEvent(module, "a-event", 0, vi); + BinaryenAddEvent( + module, "a-event", 0, BinaryenTypeInt32(), BinaryenTypeNone()); // Exception handling diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index 2c58a9777..7583a216b 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -24,10 +24,9 @@ BinaryenFeatureAll: 511 ) (module (type $iiIfF (func (param i32 i64 f32 f64) (result i32))) - (type $vi (func (param i32))) (type $fiF (func (param i32 f64) (result f32))) (type $v (func)) - (type $4 (func)) + (type $3 (func)) (import "module" "base" (func $an-imported (param i32 f64) (result f32))) (memory $0 (shared 1 256)) (data (i32.const 10) "hello, world") @@ -2285,11 +2284,7 @@ int main() { expressions[31] = BinaryenConst(the_module, BinaryenLiteralInt32(11)); expressions[32] = BinaryenConst(the_module, BinaryenLiteralInt32(110)); expressions[33] = BinaryenConst(the_module, BinaryenLiteralInt64(111)); - { - BinaryenType paramTypes[] = { 2 }; - functionTypes[1] = BinaryenAddFunctionType(the_module, "vi", 0, paramTypes, 1); - } - BinaryenAddEvent(the_module, "a-event", 0, functionTypes[1]); + BinaryenAddEvent(the_module, "a-event", 0, 2, 0); expressions[34] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); { BinaryenExpressionRef operands[] = { expressions[34] }; @@ -3963,9 +3958,9 @@ int main() { globals[1] = BinaryenAddGlobal(the_module, "a-mutable-global", 4, 1, expressions[796]); { BinaryenType paramTypes[] = { 2, 5 }; - functionTypes[2] = BinaryenAddFunctionType(the_module, "fiF", 4, paramTypes, 2); + functionTypes[1] = BinaryenAddFunctionType(the_module, "fiF", 4, paramTypes, 2); } - BinaryenAddFunctionImport(the_module, "an-imported", "module", "base", functionTypes[2]); + BinaryenAddFunctionImport(the_module, "an-imported", "module", "base", functionTypes[1]); exports[0] = BinaryenAddFunctionExport(the_module, "kitchen()sinker", "kitchen_sinker"); BinaryenFunctionGetName(functions[0]); expressions[797] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); @@ -3985,17 +3980,17 @@ int main() { } { BinaryenType paramTypes[] = { 0 }; - functionTypes[3] = BinaryenAddFunctionType(the_module, "v", 0, paramTypes, 0); + functionTypes[2] = BinaryenAddFunctionType(the_module, "v", 0, paramTypes, 0); } expressions[799] = BinaryenNop(the_module); { BinaryenType varTypes[] = { 0 }; - functions[1] = BinaryenAddFunction(the_module, "starter", functionTypes[3], varTypes, 0, expressions[799]); + functions[1] = BinaryenAddFunction(the_module, "starter", functionTypes[2], varTypes, 0, expressions[799]); } BinaryenSetStart(the_module, functions[1]); { BinaryenType paramTypes[] = { 0 }; - functionTypes[4] = BinaryenAddFunctionType(the_module, NULL, 0, paramTypes, 0); + functionTypes[3] = BinaryenAddFunctionType(the_module, NULL, 0, paramTypes, 0); } BinaryenModuleAutoDrop(the_module); BinaryenModuleSetFeatures(the_module, 511); @@ -4004,10 +3999,9 @@ int main() { BinaryenModulePrint(the_module); (module (type $iiIfF (func (param i32 i64 f32 f64) (result i32))) - (type $vi (func (param i32))) (type $fiF (func (param i32 f64) (result f32))) (type $v (func)) - (type $4 (func)) + (type $3 (func)) (import "module" "base" (func $an-imported (param i32 f64) (result f32))) (memory $0 (shared 1 256)) (data (i32.const 10) "hello, world") diff --git a/test/example/c-api-kitchen-sink.txt.txt b/test/example/c-api-kitchen-sink.txt.txt index ada00077f..92f620e73 100644 --- a/test/example/c-api-kitchen-sink.txt.txt +++ b/test/example/c-api-kitchen-sink.txt.txt @@ -3,10 +3,9 @@ ) (module (type $iiIfF (func (param i32 i64 f32 f64) (result i32))) - (type $vi (func (param i32))) (type $fiF (func (param i32 f64) (result f32))) (type $v (func)) - (type $4 (func)) + (type $3 (func)) (import "module" "base" (func $an-imported (param i32 f64) (result f32))) (memory $0 (shared 1 256)) (data (i32.const 10) "hello, world") diff --git a/test/example/c-api-unused-mem.txt b/test/example/c-api-unused-mem.txt index 41ce79ae0..56cd3a948 100644 --- a/test/example/c-api-unused-mem.txt +++ b/test/example/c-api-unused-mem.txt @@ -37,10 +37,9 @@ (call $main) ) ) -151 +148 (module (type $0 (func)) - (type $1 (func)) (memory $0 1024 1024) (export "memory" (memory $0)) (export "main" (func $main)) @@ -70,7 +69,7 @@ (unreachable) ) ) - (func $__wasm_start (; 1 ;) (type $1) + (func $__wasm_start (; 1 ;) (type $0) (i32.store (i32.const 0) (i32.const 65535) |