OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --expose-wasm | 5 // Flags: --expose-wasm |
6 | 6 |
7 function EmptyTest() { | 7 function EmptyTest() { |
8 "use asm"; | 8 "use asm"; |
9 function caller() { | 9 function caller() { |
10 empty(); | 10 empty(); |
(...skipping 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1533 var x = 0; | 1533 var x = 0; |
1534 x = HEAP32[0] & -1; | 1534 x = HEAP32[0] & -1; |
1535 return x | 0; | 1535 return x | 0; |
1536 } | 1536 } |
1537 return {func: func}; | 1537 return {func: func}; |
1538 } | 1538 } |
1539 | 1539 |
1540 var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString()); | 1540 var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString()); |
1541 assertEquals(0, m.func()); | 1541 assertEquals(0, m.func()); |
1542 })(); | 1542 })(); |
| 1543 |
| 1544 (function TestOutOfBoundsConversion() { |
| 1545 function asmModule($a,$b,$c){'use asm'; |
| 1546 function aaa() { |
| 1547 var f = 0.0; |
| 1548 var a = 0; |
| 1549 f = 5616315000.000001; |
| 1550 a = ~~f >>>0; |
| 1551 return a | 0; |
| 1552 } |
| 1553 return { main : aaa }; |
| 1554 } |
| 1555 var wasm = _WASMEXP_.instantiateModuleFromAsm(asmModule.toString()); |
| 1556 assertEquals(1321347704, wasm.main()); |
| 1557 })(); |
OLD | NEW |