summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcheck.py2
-rw-r--r--test/wasm_backend/hello_num.cpp10
-rw-r--r--test/wasm_backend/hello_num.txt1
3 files changed, 12 insertions, 1 deletions
diff --git a/check.py b/check.py
index 78dbb1751..4988dd804 100755
--- a/check.py
+++ b/check.py
@@ -285,7 +285,7 @@ if has_emcc:
print '\n[ checking emcc WASM_BACKEND testcases... ]\n'
- for c in ['hello_world.cpp']:
+ for c in ['hello_world.cpp', 'hello_num.cpp']:
print '..', c
base = c.replace('.cpp', '').replace('.c', '')
expected = open(os.path.join('test', 'wasm_backend', base + '.txt')).read()
diff --git a/test/wasm_backend/hello_num.cpp b/test/wasm_backend/hello_num.cpp
new file mode 100644
index 000000000..d272f11c6
--- /dev/null
+++ b/test/wasm_backend/hello_num.cpp
@@ -0,0 +1,10 @@
+#include <emscripten.h>
+
+int main() {
+ int *x = (int*)8;
+ *x = 123;
+ EM_ASM({
+ Module.print("hello, world " + HEAP32[8>>2] + "!");
+ });
+}
+
diff --git a/test/wasm_backend/hello_num.txt b/test/wasm_backend/hello_num.txt
new file mode 100644
index 000000000..9afd068a4
--- /dev/null
+++ b/test/wasm_backend/hello_num.txt
@@ -0,0 +1 @@
+hello, world 123!