diff options
Diffstat (limited to 'test/binaryen.js/test.js')
-rw-r--r-- | test/binaryen.js/test.js | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/test/binaryen.js/test.js b/test/binaryen.js/test.js deleted file mode 100644 index 3b6d9471b..000000000 --- a/test/binaryen.js/test.js +++ /dev/null @@ -1,44 +0,0 @@ - -Binaryen = Binaryen(); // instantiate the module - -var input = - '(module\n' + - ' (export "add" $add)\n' + - ' (func $add (param $x f64) (param $y f64) (result f64)\n' + - ' (f64.add\n' + - ' (get_local $x)\n' + - ' (get_local $y)\n' + - ' )\n' + - ' )\n' + - ')\n'; - -console.log('input:'); -console.log(input); -console.log('================'); - -var module = new Binaryen.Module(); -var parser = new Binaryen.SExpressionParser(input); - -console.log('s-expr dump:'); -parser.get_root().dump(); -var s_module = parser.get_root().getChild(0); -console.log('================'); - -var builder = new Binaryen.SExpressionWasmBuilder(module, s_module); - -console.log('module:'); -Binaryen.WasmPrinter.prototype.printModule(module); -console.log('================'); - -var interface_ = new Binaryen.ShellExternalInterface(); -var instance = new Binaryen.ModuleInstance(module, interface_); - -var name = new Binaryen.Name('add'); -console.log('name: ' + name.c_str()); - -var args = new Binaryen.LiteralList(); -args.push_back(new Binaryen.Literal(40)); -args.push_back(new Binaryen.Literal(2)); - -console.log('answer is ' + instance.callExport(name, args).getf64() + '.'); - |