(asmfunc, expect)
| 21 | } |
| 22 | |
| 23 | function RunAsmJsTest(asmfunc, expect) { |
| 24 | var asm_source = asmfunc.toString(); |
| 25 | var nonasm_source = asm_source.replace(new RegExp("use asm"), ""); |
| 26 | var stdlib = {Math: Math}; |
| 27 | |
| 28 | print("Testing " + asmfunc.name + " (js)..."); |
| 29 | var js_module = eval("(" + nonasm_source + ")")(stdlib); |
| 30 | expect(js_module); |
| 31 | |
| 32 | print("Testing " + asmfunc.name + " (asm.js)..."); |
| 33 | var asm_module = asmfunc(stdlib); |
| 34 | assertTrue(%IsAsmWasmCode(asmfunc)); |
| 35 | expect(asm_module); |
| 36 | } |
| 37 | |
| 38 | const imul = Math.imul; |
| 39 |
no test coverage detected