summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-07-11 15:22:58 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-07-12 13:53:26 -0700
commitf050b6300ceb6039d608abc20939ebf241378cdc (patch)
tree2c1f911f38b436ec4d50a8f5382730cef84d55de /test
parent91e38285dc27e5dbac3291258342835fc3e90eab (diff)
downloadbinaryen-f050b6300ceb6039d608abc20939ebf241378cdc.tar.gz
binaryen-f050b6300ceb6039d608abc20939ebf241378cdc.tar.bz2
binaryen-f050b6300ceb6039d608abc20939ebf241378cdc.zip
allow multiple traces
Diffstat (limited to 'test')
-rw-r--r--test/example/c-api-kitchen-sink.c9
-rw-r--r--test/example/c-api-kitchen-sink.txt6
2 files changed, 6 insertions, 9 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index 4f1d839c0..ddfffb0d7 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -53,15 +53,15 @@ BinaryenExpressionRef makeSomething(BinaryenModuleRef module) {
// tests
-void test_core() {
-
- // Core types
-
+void test_types() {
printf("BinaryenNone: %d\n", BinaryenNone());
printf("BinaryenInt32: %d\n", BinaryenInt32());
printf("BinaryenInt64: %d\n", BinaryenInt64());
printf("BinaryenFloat32: %d\n", BinaryenFloat32());
printf("BinaryenFloat64: %d\n", BinaryenFloat64());
+}
+
+void test_core() {
// Module creation
@@ -507,6 +507,7 @@ void test_tracing() {
}
int main() {
+ test_types();
test_core();
test_relooper();
test_binaries();
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index e6e266f02..9aab653ac 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -817,11 +817,6 @@ module loaded from binary form:
)
)
validation: 0
-BinaryenNone: 0
-BinaryenInt32: 1
-BinaryenInt64: 2
-BinaryenFloat32: 3
-BinaryenFloat64: 4
// beginning a Binaryen API trace
#include <math.h>
#include <map>
@@ -834,6 +829,7 @@ int main() {
std::map<size_t, RelooperBlockRef> relooperBlocks;
BinaryenModuleRef the_module = BinaryenModuleCreate();
RelooperRef the_relooper = NULL;
+ the_module = BinaryenModuleCreate();
expressions[1] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
expressions[2] = BinaryenConst(the_module, BinaryenLiteralInt64(2));
expressions[3] = BinaryenConst(the_module, BinaryenLiteralFloat32(3.14));