summaryrefslogtreecommitdiff
path: root/test/example
diff options
context:
space:
mode:
authorericvergnaud <eric.vergnaud@wanadoo.fr>2024-01-25 22:21:25 +0100
committerGitHub <noreply@github.com>2024-01-25 13:21:25 -0800
commit0375d95a6e134c05ae5478164799a152051826a7 (patch)
tree9e7b68b3d09513ae6236d42f48be2351dbe64ee5 /test/example
parent976bd6da4a54505ffc65f18913fbb9aff652e72d (diff)
downloadbinaryen-0375d95a6e134c05ae5478164799a152051826a7.tar.gz
binaryen-0375d95a6e134c05ae5478164799a152051826a7.tar.bz2
binaryen-0375d95a6e134c05ae5478164799a152051826a7.zip
C API: Add BinaryenArrayNewData (#6236)
Diffstat (limited to 'test/example')
-rw-r--r--test/example/c-api-kitchen-sink.c5
-rw-r--r--test/example/c-api-kitchen-sink.txt6
2 files changed, 11 insertions, 0 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index 6db92276e..edf8d61f7 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -1128,6 +1128,11 @@ void test_core() {
BinaryenTypeGetHeapType(i8Array),
makeInt32(module, 3),
makeInt32(module, 42)),
+ BinaryenArrayNewData(module,
+ BinaryenTypeGetHeapType(i8Array),
+ "0",
+ makeInt32(module, 0),
+ makeInt32(module, 2)),
BinaryenArrayNewFixed(module,
BinaryenTypeGetHeapType(i8Array),
(BinaryenExpressionRef[]){makeInt32(module, 1),
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index 5342236e1..4f4b4ec80 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -2305,6 +2305,12 @@ BinaryenFeatureAll: 131071
)
)
(drop
+ (array.new_data $0 $0
+ (i32.const 0)
+ (i32.const 2)
+ )
+ )
+ (drop
(array.new_fixed $0 3
(i32.const 1)
(i32.const 2)