summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/add.c6
-rw-r--r--test/add.post.js6
-rw-r--r--test/add.txt5
3 files changed, 17 insertions, 0 deletions
diff --git a/test/add.c b/test/add.c
new file mode 100644
index 000000000..a7d7e982f
--- /dev/null
+++ b/test/add.c
@@ -0,0 +1,6 @@
+#include <emscripten.h>
+
+int EMSCRIPTEN_KEEPALIVE add(int x, int y) {
+ return x + y;
+}
+
diff --git a/test/add.post.js b/test/add.post.js
new file mode 100644
index 000000000..a5ceeda53
--- /dev/null
+++ b/test/add.post.js
@@ -0,0 +1,6 @@
+
+Module.print(Module._add(1, 1));
+Module.print(Module._add(5, 6));
+Module.print(Module._add(6, 5));
+Module.print(Module._add(-12, 101));
+
diff --git a/test/add.txt b/test/add.txt
new file mode 100644
index 000000000..f57c2a3b9
--- /dev/null
+++ b/test/add.txt
@@ -0,0 +1,5 @@
+2
+11
+11
+89
+