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: --validate-asm --allow-natives-syntax | 5 // Flags: --validate-asm --allow-natives-syntax |
6 | 6 |
7 var stdlib = this; | 7 var stdlib = this; |
8 | 8 |
9 function assertValidAsm(func) { | 9 function assertValidAsm(func) { |
10 assertTrue(%IsAsmWasmCode(func)); | 10 assertTrue(%IsAsmWasmCode(func)); |
(...skipping 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1621 return 44; | 1621 return 44; |
1622 } else { | 1622 } else { |
1623 return 55; | 1623 return 55; |
1624 } | 1624 } |
1625 return 0; | 1625 return 0; |
1626 } | 1626 } |
1627 return {caller: caller}; | 1627 return {caller: caller}; |
1628 } | 1628 } |
1629 | 1629 |
1630 assertWasm(55, TestNotOne); | 1630 assertWasm(55, TestNotOne); |
| 1631 |
| 1632 |
| 1633 function TestDotfulFloat(stdlib) { |
| 1634 "use asm"; |
| 1635 var fround = stdlib.Math.fround; |
| 1636 var foo = fround(55.0); |
| 1637 function caller() { |
| 1638 return +foo; |
| 1639 } |
| 1640 return {caller: caller}; |
| 1641 } |
| 1642 |
| 1643 assertWasm(55, TestDotfulFloat); |
| 1644 |
| 1645 |
| 1646 function TestDotlessFloat(stdlib) { |
| 1647 "use asm"; |
| 1648 var fround = stdlib.Math.fround; |
| 1649 var foo = fround(55); |
| 1650 function caller() { |
| 1651 return +foo; |
| 1652 } |
| 1653 return {caller: caller}; |
| 1654 } |
| 1655 |
| 1656 assertWasm(55, TestDotlessFloat); |
| 1657 |
| 1658 |
| 1659 function TestFloatGlobals(stdlib) { |
| 1660 "use asm"; |
| 1661 var fround = stdlib.Math.fround; |
| 1662 var foo = fround(1.25); |
| 1663 function caller() { |
| 1664 foo = fround(foo + fround(1.0)); |
| 1665 foo = fround(foo + fround(1.0)); |
| 1666 return +foo; |
| 1667 } |
| 1668 return {caller: caller}; |
| 1669 } |
| 1670 |
| 1671 assertWasm(3.25, TestFloatGlobals); |
OLD | NEW |