summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/example/c-api-kitchen-sink.c16
-rw-r--r--test/example/c-api-kitchen-sink.txt3
2 files changed, 19 insertions, 0 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index 9f8c9a640..64a386a51 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -1693,6 +1693,21 @@ void test_func_opt() {
BinaryenModuleDispose(module);
}
+void test_typesystem() {
+ BinaryenTypeSystem defaultTypeSystem = BinaryenGetTypeSystem();
+ assert(defaultTypeSystem == BinaryenTypeSystemEquirecursive());
+ printf("BinaryenTypeSystemEquirecursive: %d\n",
+ BinaryenTypeSystemEquirecursive());
+ BinaryenSetTypeSystem(BinaryenTypeSystemNominal());
+ assert(BinaryenGetTypeSystem() == BinaryenTypeSystemNominal());
+ printf("BinaryenTypeSystemNominal: %d\n", BinaryenTypeSystemNominal());
+ BinaryenSetTypeSystem(BinaryenTypeSystemIsorecursive());
+ assert(BinaryenGetTypeSystem() == BinaryenTypeSystemIsorecursive());
+ printf("BinaryenTypeSystemIsorecursive: %d\n",
+ BinaryenTypeSystemIsorecursive());
+ BinaryenSetTypeSystem(defaultTypeSystem);
+}
+
int main() {
test_types();
test_features();
@@ -1705,6 +1720,7 @@ int main() {
test_color_status();
test_for_each();
test_func_opt();
+ test_typesystem();
return 0;
}
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index 211c7003b..0793da811 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -2703,3 +2703,6 @@ optimized:
(i32.const 4)
)
)
+BinaryenTypeSystemEquirecursive: 0
+BinaryenTypeSystemNominal: 1
+BinaryenTypeSystemIsorecursive: 2