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 = 'sum:8930\n'; | 4 var EXPECTED_OUTPUT = 'sum:8930\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 5752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5763 function stackSave() { | 5763 function stackSave() { |
5764 return STACKTOP | 0; | 5764 return STACKTOP | 0; |
5765 } | 5765 } |
5766 | 5766 |
5767 // EMSCRIPTEN_END_FUNCS | 5767 // EMSCRIPTEN_END_FUNCS |
5768 | 5768 |
5769 | 5769 |
5770 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 }; | 5770 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 }; |
5771 }).toString(), | 5771 }).toString(), |
5772 // EMSCRIPTEN_END_ASM | 5772 // EMSCRIPTEN_END_ASM |
5773 { "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, "__reallyNega
tive": __reallyNegative, "_fwrite": _fwrite, "_malloc": _malloc, "_mkport": _mkp
ort, "_fprintf": _fprintf, "___setErrNo": ___setErrNo, "__formatString": __forma
tString, "_fileno": _fileno, "_fflush": _fflush, "_write": _write, "STACKTOP": S
TACKTOP, "STACK_MAX": STACK_MAX, "tempDoublePtr": tempDoublePtr, "ABORT": ABORT,
"NaN": NaN, "Infinity": Infinity }, buffer); | 5773 { "Math": Math, "Int8Array": Int8Array, "Int16Array": Int16Array, "Int32Array":
Int32Array, "Uint8Array": Uint8Array, "Uint16Array": Uint16Array, "Uint32Array":
Uint32Array, "Float32Array": Float32Array, "Float64Array": Float64Array}, {"abo
rt": abort, "assert": assert, "asmPrintInt": asmPrintInt, "asmPrintFloat": asmPr
intFloat, "min": Math_min, "_free": _free, "_emscripten_memcpy_big": _emscripten
_memcpy_big, "_printf": _printf, "_send": _send, "_pwrite": _pwrite, "__reallyNe
gative": __reallyNegative, "_fwrite": _fwrite, "_malloc": _malloc, "_mkport": _m
kport, "_fprintf": _fprintf, "___setErrNo": ___setErrNo, "__formatString": __for
matString, "_fileno": _fileno, "_fflush": _fflush, "_write": _write, "STACKTOP":
STACKTOP, "STACK_MAX": STACK_MAX, "tempDoublePtr": tempDoublePtr, "ABORT": ABOR
T, "NaN": NaN, "Infinity": Infinity }, buffer); |
5774 var _strlen = Module["_strlen"] = asm["_strlen"]; | 5774 var _strlen = Module["_strlen"] = asm["_strlen"]; |
5775 var _memcpy = Module["_memcpy"] = asm["_memcpy"]; | 5775 var _memcpy = Module["_memcpy"] = asm["_memcpy"]; |
5776 var _main = Module["_main"] = asm["_main"]; | 5776 var _main = Module["_main"] = asm["_main"]; |
5777 var _memset = Module["_memset"] = asm["_memset"]; | 5777 var _memset = Module["_memset"] = asm["_memset"]; |
5778 var runPostSets = Module["runPostSets"] = asm["runPostSets"]; | 5778 var runPostSets = Module["runPostSets"] = asm["runPostSets"]; |
5779 | 5779 |
5780 Runtime.stackAlloc = function(size) { return asm['stackAlloc'](size) }; | 5780 Runtime.stackAlloc = function(size) { return asm['stackAlloc'](size) }; |
5781 Runtime.stackSave = function() { return asm['stackSave']() }; | 5781 Runtime.stackSave = function() { return asm['stackSave']() }; |
5782 Runtime.stackRestore = function(top) { asm['stackRestore'](top) }; | 5782 Runtime.stackRestore = function(top) { asm['stackRestore'](top) }; |
5783 | 5783 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5970 } | 5970 } |
5971 | 5971 |
5972 // shouldRunNow refers to calling main(), not run(). | 5972 // shouldRunNow refers to calling main(), not run(). |
5973 var shouldRunNow = true; | 5973 var shouldRunNow = true; |
5974 if (Module['noInitialRun']) { | 5974 if (Module['noInitialRun']) { |
5975 shouldRunNow = false; | 5975 shouldRunNow = false; |
5976 } | 5976 } |
5977 | 5977 |
5978 | 5978 |
5979 run([].concat(Module["arguments"])); | 5979 run([].concat(Module["arguments"])); |
OLD | NEW |