| 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 IntTest() { | 7 function IntTest() { |
| 8 "use asm"; | 8 "use asm"; |
| 9 function sum(a, b) { | 9 function sum(a, b) { |
| 10 a = a|0; | 10 a = a|0; |
| 11 b = b|0; | 11 b = b|0; |
| 12 var c = (b + 1)|0 | 12 var c = (b + 1)|0 |
| 13 var d = 3.0; |
| 14 var e = d | 0; // double conversion |
| 13 return (a + c + 1)|0; | 15 return (a + c + 1)|0; |
| 14 } | 16 } |
| 15 | 17 |
| 16 function caller() { | 18 function caller() { |
| 17 return sum(77,22) | 0; | 19 return sum(77,22) | 0; |
| 18 } | 20 } |
| 19 | 21 |
| 20 return {caller: caller}; | 22 return {caller: caller}; |
| 21 } | 23 } |
| 22 | 24 |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 } | 737 } |
| 736 default: return 0; | 738 default: return 0; |
| 737 } | 739 } |
| 738 return 0; | 740 return 0; |
| 739 } | 741 } |
| 740 | 742 |
| 741 return {caller:caller}; | 743 return {caller:caller}; |
| 742 } | 744 } |
| 743 | 745 |
| 744 assertEquals(43, WASM.asmCompileRun(TestNestedSwitch.toString())); | 746 assertEquals(43, WASM.asmCompileRun(TestNestedSwitch.toString())); |
| OLD | NEW |