| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // Dart test program for constructors and initializers. | 4 // Dart test program for constructors and initializers. |
| 5 | 5 |
| 6 import "package:expect/expect.dart"; | |
| 7 | |
| 8 // Check that range analysis does not enter infinite loop trying to propagate | 6 // Check that range analysis does not enter infinite loop trying to propagate |
| 9 // ranges through dependant phis. | 7 // ranges through dependant phis. |
| 10 bar() { | 8 bar() { |
| 11 var sum = 0; | 9 var sum = 0; |
| 12 for (var i = 0; i < 10; i++) { | 10 for (var i = 0; i < 10; i++) { |
| 13 for (var j = i - 1; j >= 0; j--) { | 11 for (var j = i - 1; j >= 0; j--) { |
| 14 for (var k = j; k < i; k++) { | 12 for (var k = j; k < i; k++) { |
| 15 sum += (i + j + k); | 13 sum += (i + j + k); |
| 16 } | 14 } |
| 17 } | 15 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 36 Expect.isTrue(i > 0); | 34 Expect.isTrue(i > 0); |
| 37 x = i; | 35 x = i; |
| 38 } | 36 } |
| 39 return x; | 37 return x; |
| 40 } | 38 } |
| 41 | 39 |
| 42 main() { | 40 main() { |
| 43 test1(); | 41 test1(); |
| 44 test2(); | 42 test2(); |
| 45 } | 43 } |
| OLD | NEW |