diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/example/c-api-kitchen-sink.c | 3 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c index cb26c372d..36e6776f7 100644 --- a/test/example/c-api-kitchen-sink.c +++ b/test/example/c-api-kitchen-sink.c @@ -2309,6 +2309,9 @@ void test_typebuilder() { varTypes, 4, BinaryenNop(module)); + // Also test adding a function using the HeapType-using API. + BinaryenAddFunctionWithHeapType( + module, "test2", signatureHeapType, NULL, 0, BinaryenUnreachable(module)); } bool didValidate = BinaryenModuleValidate(module); assert(didValidate); diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index 75a4d1d8d..1276a5a6a 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -3167,8 +3167,8 @@ TypeBuilderErrorReasonForwardChildReference: 3 module with recursive GC types: (module (type $SomeArray (array (mut (ref null $SomeArray)))) - (type $SomeStruct (struct (field $SomeField (mut (ref null $SomeStruct))))) (type $SomeSignature (func (param (ref null $SomeSignature) (ref null $SomeArray)) (result (ref null $SomeSignature)))) + (type $SomeStruct (struct (field $SomeField (mut (ref null $SomeStruct))))) (type $none_=>_none (func)) (type $SomeSubStruct (sub $SomeStruct (struct (field $SomeField (mut (ref null $SomeStruct))) (field $SomePackedField i8)))) (func $test (type $none_=>_none) @@ -3178,4 +3178,7 @@ module with recursive GC types: (local $3 (ref null $SomeSubStruct)) (nop) ) + (func $test2 (type $SomeSignature) (param $0 (ref null $SomeSignature)) (param $1 (ref null $SomeArray)) (result (ref null $SomeSignature)) + (unreachable) + ) ) |