OLD | NEW |
1 // Modified embenchen to direct to asm-wasm. | 1 // Modified embenchen to direct to asm-wasm. |
2 // Flags: --expose-wasm | 2 // Flags: --expose-wasm |
3 | 3 |
4 var EXPECTED_OUTPUT = 'lastprime: 387677.\n'; | 4 var EXPECTED_OUTPUT = 'lastprime: 387677.\n'; |
5 var Module = { | 5 var Module = { |
6 arguments: [1], | 6 arguments: [1], |
7 print: function(x) {Module.printBuffer += x + '\n';}, | 7 print: function(x) {Module.printBuffer += x + '\n';}, |
8 preRun: [function() {Module.printBuffer = ''}], | 8 preRun: [function() {Module.printBuffer = ''}], |
9 postRun: [function() { | 9 postRun: [function() { |
10 assertEquals(EXPECTED_OUTPUT, Module.printBuffer); | 10 assertEquals(EXPECTED_OUTPUT, Module.printBuffer); |
(...skipping 5760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5771 function stackSave() { | 5771 function stackSave() { |
5772 return STACKTOP | 0; | 5772 return STACKTOP | 0; |
5773 } | 5773 } |
5774 | 5774 |
5775 // EMSCRIPTEN_END_FUNCS | 5775 // EMSCRIPTEN_END_FUNCS |
5776 | 5776 |
5777 | 5777 |
5778 return { _strlen: _strlen, _memcpy: _memcpy, _main: _main, _memset: _memset, r
unPostSets: runPostSets, stackAlloc: stackAlloc, stackSave: stackSave, stackRest
ore: stackRestore, setThrew: setThrew, setTempRet0: setTempRet0, setTempRet1: se
tTempRet1, setTempRet2: setTempRet2, setTempRet3: setTempRet3, setTempRet4: setT
empRet4, setTempRet5: setTempRet5, setTempRet6: setTempRet6, setTempRet7: setTem
pRet7, setTempRet8: setTempRet8, setTempRet9: setTempRet9 }; | 5778 return { _strlen: _strlen, _memcpy: _memcpy, _main: _main, _memset: _memset, r
unPostSets: runPostSets, stackAlloc: stackAlloc, stackSave: stackSave, stackRest
ore: stackRestore, setThrew: setThrew, setTempRet0: setTempRet0, setTempRet1: se
tTempRet1, setTempRet2: setTempRet2, setTempRet3: setTempRet3, setTempRet4: setT
empRet4, setTempRet5: setTempRet5, setTempRet6: setTempRet6, setTempRet7: setTem
pRet7, setTempRet8: setTempRet8, setTempRet9: setTempRet9 }; |
5779 }).toString(), | 5779 }).toString(), |
5780 // EMSCRIPTEN_END_ASM | 5780 // EMSCRIPTEN_END_ASM |
5781 { "Math": Math, "Int8Array": Int8Array, "Int16Array": Int16Array, "Int32Array":
Int32Array, "Uint8Array": Uint8Array, "Uint16Array": Uint16Array, "Uint32Array":
Uint32Array, "Float32Array": Float32Array, "Float64Array": Float64Array, "abort
": abort, "assert": assert, "asmPrintInt": asmPrintInt, "asmPrintFloat": asmPrin
tFloat, "min": Math_min, "_free": _free, "_emscripten_memcpy_big": _emscripten_m
emcpy_big, "_printf": _printf, "_send": _send, "_pwrite": _pwrite, "_sqrtf": _sq
rtf, "__reallyNegative": __reallyNegative, "_fwrite": _fwrite, "_malloc": _mallo
c, "_mkport": _mkport, "_fprintf": _fprintf, "___setErrNo": ___setErrNo, "__form
atString": __formatString, "_fileno": _fileno, "_fflush": _fflush, "_write": _wr
ite, "STACKTOP": STACKTOP, "STACK_MAX": STACK_MAX, "tempDoublePtr": tempDoublePt
r, "ABORT": ABORT, "NaN": NaN, "Infinity": Infinity }, buffer); | 5781 { "Math": Math, "Int8Array": Int8Array, "Int16Array": Int16Array, "Int32Array":
Int32Array, "Uint8Array": Uint8Array, "Uint16Array": Uint16Array, "Uint32Array":
Uint32Array, "Float32Array": Float32Array, "Float64Array": Float64Array }, { "a
bort": abort, "assert": assert, "asmPrintInt": asmPrintInt, "asmPrintFloat": asm
PrintFloat, "min": Math_min, "_free": _free, "_emscripten_memcpy_big": _emscript
en_memcpy_big, "_printf": _printf, "_send": _send, "_pwrite": _pwrite, "_sqrtf":
_sqrtf, "__reallyNegative": __reallyNegative, "_fwrite": _fwrite, "_malloc": _m
alloc, "_mkport": _mkport, "_fprintf": _fprintf, "___setErrNo": ___setErrNo, "__
formatString": __formatString, "_fileno": _fileno, "_fflush": _fflush, "_write":
_write, "STACKTOP": STACKTOP, "STACK_MAX": STACK_MAX, "tempDoublePtr": tempDoub
lePtr, "ABORT": ABORT, "NaN": NaN, "Infinity": Infinity }, buffer); |
5782 var _strlen = Module["_strlen"] = asm["_strlen"]; | 5782 var _strlen = Module["_strlen"] = asm["_strlen"]; |
5783 var _memcpy = Module["_memcpy"] = asm["_memcpy"]; | 5783 var _memcpy = Module["_memcpy"] = asm["_memcpy"]; |
5784 var _main = Module["_main"] = asm["_main"]; | 5784 var _main = Module["_main"] = asm["_main"]; |
5785 var _memset = Module["_memset"] = asm["_memset"]; | 5785 var _memset = Module["_memset"] = asm["_memset"]; |
5786 var runPostSets = Module["runPostSets"] = asm["runPostSets"]; | 5786 var runPostSets = Module["runPostSets"] = asm["runPostSets"]; |
5787 | 5787 |
5788 Runtime.stackAlloc = function(size) { return asm['stackAlloc'](size) }; | 5788 Runtime.stackAlloc = function(size) { return asm['stackAlloc'](size) }; |
5789 Runtime.stackSave = function() { return asm['stackSave']() }; | 5789 Runtime.stackSave = function() { return asm['stackSave']() }; |
5790 Runtime.stackRestore = function(top) { asm['stackRestore'](top) }; | 5790 Runtime.stackRestore = function(top) { asm['stackRestore'](top) }; |
5791 | 5791 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5978 } | 5978 } |
5979 | 5979 |
5980 // shouldRunNow refers to calling main(), not run(). | 5980 // shouldRunNow refers to calling main(), not run(). |
5981 var shouldRunNow = true; | 5981 var shouldRunNow = true; |
5982 if (Module['noInitialRun']) { | 5982 if (Module['noInitialRun']) { |
5983 shouldRunNow = false; | 5983 shouldRunNow = false; |
5984 } | 5984 } |
5985 | 5985 |
5986 | 5986 |
5987 run([].concat(Module["arguments"])); | 5987 run([].concat(Module["arguments"])); |
OLD | NEW |