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() { |
| 8 "use asm"; |
| 9 function caller() { |
| 10 empty(); |
| 11 return 11; |
| 12 } |
| 13 function empty() { |
| 14 } |
| 15 return {caller: caller}; |
| 16 } |
| 17 |
| 18 assertEquals(11, WASM.asmCompileRun(EmptyTest.toString())); |
| 19 |
7 function IntTest() { | 20 function IntTest() { |
8 "use asm"; | 21 "use asm"; |
9 function sum(a, b) { | 22 function sum(a, b) { |
10 a = a|0; | 23 a = a|0; |
11 b = b|0; | 24 b = b|0; |
12 var c = (b + 1)|0 | 25 var c = (b + 1)|0 |
13 return (a + c + 1)|0; | 26 return (a + c + 1)|0; |
14 } | 27 } |
15 | 28 |
16 function caller() { | 29 function caller() { |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 } | 748 } |
736 default: return 0; | 749 default: return 0; |
737 } | 750 } |
738 return 0; | 751 return 0; |
739 } | 752 } |
740 | 753 |
741 return {caller:caller}; | 754 return {caller:caller}; |
742 } | 755 } |
743 | 756 |
744 assertEquals(43, WASM.asmCompileRun(TestNestedSwitch.toString())); | 757 assertEquals(43, WASM.asmCompileRun(TestNestedSwitch.toString())); |
OLD | NEW |