(asm_source, orig)
| 124 | } |
| 125 | |
| 126 | function doTest(asm_source, orig) { |
| 127 | var nonasm_source = asm_source.replace(new RegExp("use asm"), ""); |
| 128 | print("Testing JS: " + orig); |
| 129 | var js_module = eval("(" + nonasm_source + ")")(stdlib, {}, buffer); |
| 130 | expect(js_module); |
| 131 | |
| 132 | print("Testing ASMJS: " + orig); |
| 133 | var asmfunc = eval("(" + asm_source + ")"); |
| 134 | var asm_module = asmfunc(stdlib, {}, buffer); |
| 135 | assertTrue(%IsAsmWasmCode(asmfunc)); |
| 136 | expect(asm_module); |
| 137 | } |
| 138 | |
| 139 | function expect(module) { module.main(0, 0, 0); print(" ok"); return true; } |
| 140 | } |
no test coverage detected