summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-10-31 20:07:54 -0700
committerAlon Zakai <alonzakai@gmail.com>2015-10-31 20:07:54 -0700
commitb85cd243b3e289e0dda56d37cd7649883a085e6a (patch)
tree0e847c084b0f1225abc364012efdf68b07c98323
parent0aa0bf8fe5e87cfafee3d13209f0457b3e3f7764 (diff)
downloadbinaryen-b85cd243b3e289e0dda56d37cd7649883a085e6a.tar.gz
binaryen-b85cd243b3e289e0dda56d37cd7649883a085e6a.tar.bz2
binaryen-b85cd243b3e289e0dda56d37cd7649883a085e6a.zip
add simple add test
-rwxr-xr-xemcc_to_polyfill.sh2
-rw-r--r--test/add.c6
-rw-r--r--test/add.post.js6
-rw-r--r--test/add.txt5
4 files changed, 19 insertions, 0 deletions
diff --git a/emcc_to_polyfill.sh b/emcc_to_polyfill.sh
index 7fa54f84b..f806aa1dd 100755
--- a/emcc_to_polyfill.sh
+++ b/emcc_to_polyfill.sh
@@ -1,5 +1,7 @@
#!/bin/sh
+set -e
+
echo "calling emcc"
emcc $1 -o a.html --separate-asm -O2 -profiling -s DEMANGLE_SUPPORT=1 -s TOTAL_MEMORY=67108864
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
+