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 = 'final: 840.\n'; | 4 var EXPECTED_OUTPUT = 'final: 840.\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 7861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7872 function stackSave() { | 7872 function stackSave() { |
7873 return STACKTOP | 0; | 7873 return STACKTOP | 0; |
7874 } | 7874 } |
7875 | 7875 |
7876 // EMSCRIPTEN_END_FUNCS | 7876 // EMSCRIPTEN_END_FUNCS |
7877 | 7877 |
7878 | 7878 |
7879 return { _strlen: _strlen, _free: _free, _main: _main, _memset: _memset, _mall
oc: _malloc, _memcpy: _memcpy, runPostSets: runPostSets, stackAlloc: stackAlloc,
stackSave: stackSave, stackRestore: stackRestore, setThrew: setThrew, setTempRe
t0: setTempRet0, setTempRet1: setTempRet1, setTempRet2: setTempRet2, setTempRet3
: setTempRet3, setTempRet4: setTempRet4, setTempRet5: setTempRet5, setTempRet6:
setTempRet6, setTempRet7: setTempRet7, setTempRet8: setTempRet8, setTempRet9: se
tTempRet9 }; | 7879 return { _strlen: _strlen, _free: _free, _main: _main, _memset: _memset, _mall
oc: _malloc, _memcpy: _memcpy, runPostSets: runPostSets, stackAlloc: stackAlloc,
stackSave: stackSave, stackRestore: stackRestore, setThrew: setThrew, setTempRe
t0: setTempRet0, setTempRet1: setTempRet1, setTempRet2: setTempRet2, setTempRet3
: setTempRet3, setTempRet4: setTempRet4, setTempRet5: setTempRet5, setTempRet6:
setTempRet6, setTempRet7: setTempRet7, setTempRet8: setTempRet8, setTempRet9: se
tTempRet9 }; |
7880 }).toString(), | 7880 }).toString(), |
7881 // EMSCRIPTEN_END_ASM | 7881 // EMSCRIPTEN_END_ASM |
7882 { "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, "_fflush": _fflush, "_emscripten_memcpy_big": _emscript
en_memcpy_big, "_printf": _printf, "_send": _send, "_pwrite": _pwrite, "_abort":
_abort, "___setErrNo": ___setErrNo, "_fwrite": _fwrite, "_sbrk": _sbrk, "_time"
: _time, "_mkport": _mkport, "__reallyNegative": __reallyNegative, "__formatStri
ng": __formatString, "_fileno": _fileno, "_write": _write, "_fprintf": _fprintf,
"_sysconf": _sysconf, "___errno_location": ___errno_location, "STACKTOP": STACK
TOP, "STACK_MAX": STACK_MAX, "tempDoublePtr": tempDoublePtr, "ABORT": ABORT, "Na
N": NaN, "Infinity": Infinity }, buffer); | 7882 { "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, "_fflush": _fflush, "_emscripten_memcpy_big": _emsc
ripten_memcpy_big, "_printf": _printf, "_send": _send, "_pwrite": _pwrite, "_abo
rt": _abort, "___setErrNo": ___setErrNo, "_fwrite": _fwrite, "_sbrk": _sbrk, "_t
ime": _time, "_mkport": _mkport, "__reallyNegative": __reallyNegative, "__format
String": __formatString, "_fileno": _fileno, "_write": _write, "_fprintf": _fpri
ntf, "_sysconf": _sysconf, "___errno_location": ___errno_location, "STACKTOP": S
TACKTOP, "STACK_MAX": STACK_MAX, "tempDoublePtr": tempDoublePtr, "ABORT": ABORT,
"NaN": NaN, "Infinity": Infinity }, buffer); |
7883 var _strlen = Module["_strlen"] = asm["_strlen"]; | 7883 var _strlen = Module["_strlen"] = asm["_strlen"]; |
7884 var _free = Module["_free"] = asm["_free"]; | 7884 var _free = Module["_free"] = asm["_free"]; |
7885 var _main = Module["_main"] = asm["_main"]; | 7885 var _main = Module["_main"] = asm["_main"]; |
7886 var _memset = Module["_memset"] = asm["_memset"]; | 7886 var _memset = Module["_memset"] = asm["_memset"]; |
7887 var _malloc = Module["_malloc"] = asm["_malloc"]; | 7887 var _malloc = Module["_malloc"] = asm["_malloc"]; |
7888 var _memcpy = Module["_memcpy"] = asm["_memcpy"]; | 7888 var _memcpy = Module["_memcpy"] = asm["_memcpy"]; |
7889 var runPostSets = Module["runPostSets"] = asm["runPostSets"]; | 7889 var runPostSets = Module["runPostSets"] = asm["runPostSets"]; |
7890 | 7890 |
7891 Runtime.stackAlloc = function(size) { return asm['stackAlloc'](size) }; | 7891 Runtime.stackAlloc = function(size) { return asm['stackAlloc'](size) }; |
7892 Runtime.stackSave = function() { return asm['stackSave']() }; | 7892 Runtime.stackSave = function() { return asm['stackSave']() }; |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8081 } | 8081 } |
8082 | 8082 |
8083 // shouldRunNow refers to calling main(), not run(). | 8083 // shouldRunNow refers to calling main(), not run(). |
8084 var shouldRunNow = true; | 8084 var shouldRunNow = true; |
8085 if (Module['noInitialRun']) { | 8085 if (Module['noInitialRun']) { |
8086 shouldRunNow = false; | 8086 shouldRunNow = false; |
8087 } | 8087 } |
8088 | 8088 |
8089 | 8089 |
8090 run([].concat(Module["arguments"])); | 8090 run([].concat(Module["arguments"])); |
OLD | NEW |