summaryrefslogtreecommitdiff
path: root/test/binaryen.js/emit_asmjs.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/binaryen.js/emit_asmjs.js')
-rw-r--r--test/binaryen.js/emit_asmjs.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/binaryen.js/emit_asmjs.js b/test/binaryen.js/emit_asmjs.js
new file mode 100644
index 000000000..6848f5f01
--- /dev/null
+++ b/test/binaryen.js/emit_asmjs.js
@@ -0,0 +1,11 @@
+var module = new Binaryen.Module();
+
+var signature = module.addFunctionType("ii", Binaryen.i32, [ Binaryen.i32 ]);
+
+module.addFunction("main", signature, [], module.getLocal(0, Binaryen.i32));
+
+module.addExport("main", "main");
+
+module.validate(); // should validate before calling emitAsmjs
+
+console.log(module.emitAsmjs());