(asmfunc, expect)
| 5 | // Flags: --validate-asm --allow-natives-syntax |
| 6 | |
| 7 | function RunAsmJsTest(asmfunc, expect) { |
| 8 | var asm_source = asmfunc.toString(); |
| 9 | var nonasm_source = asm_source.replace(new RegExp("use asm"), ""); |
| 10 | var stdlib = {Math: Math}; |
| 11 | |
| 12 | print("Testing " + asmfunc.name + " (js)..."); |
| 13 | var js_module = eval("(" + nonasm_source + ")")(stdlib); |
| 14 | expect(js_module); |
| 15 | |
| 16 | print("Testing " + asmfunc.name + " (asm.js)..."); |
| 17 | var asm_module = asmfunc(stdlib); |
| 18 | assertTrue(%IsAsmWasmCode(asmfunc)); |
| 19 | expect(asm_module); |
| 20 | } |
| 21 | |
| 22 | function PositiveIntLiterals() { |
| 23 | "use asm"; |
no test coverage detected