Implement some arithmetic instructions in WebAssembly
[WebKit-https.git] / Source / JavaScriptCore / tests / stress / wasm-arithmetic.js
1 //@ skip
2
3 /*
4 wasm-arithmetic.wasm is generated by pack-asmjs <https://github.com/WebAssembly/polyfill-prototype-1> from the following script:
5
6 function asmModule(global, env, buffer) {
7     "use asm";
8
9     function main() {
10         return (10 + 40) - 8;
11     }
12
13     return {
14         main: main
15     };
16 }
17 */
18
19 var module = loadWebAssembly("wasm-arithmetic.wasm");
20 var result = module.main();
21 if (result != 42)
22     throw "Error: bad result: " + result;