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 |
| 6 |
5 function IntTest() { | 7 function IntTest() { |
6 "use asm"; | 8 "use asm"; |
7 function sum(a, b) { | 9 function sum(a, b) { |
8 a = a|0; | 10 a = a|0; |
9 b = b|0; | 11 b = b|0; |
10 var c = (b + 1)|0 | 12 var c = (b + 1)|0 |
11 return (a + c + 1)|0; | 13 return (a + c + 1)|0; |
12 } | 14 } |
13 | 15 |
14 function caller() { | 16 function caller() { |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 var i = 0; | 631 var i = 0; |
630 for (i=1; i < 45 ; i = (i+1)|0) { | 632 for (i=1; i < 45 ; i = (i+1)|0) { |
631 } | 633 } |
632 return i|0; | 634 return i|0; |
633 } | 635 } |
634 | 636 |
635 return {caller:caller}; | 637 return {caller:caller}; |
636 } | 638 } |
637 | 639 |
638 assertEquals(45, WASM.asmCompileRun(TestForLoopWithoutBody.toString())); | 640 assertEquals(45, WASM.asmCompileRun(TestForLoopWithoutBody.toString())); |
OLD | NEW |