| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // VMOptions=-DUSE_CPS_IR=true | 4 // VMOptions=-DUSE_CPS_IR=true |
| 5 | 5 |
| 6 // Tests of control flow statements. | 6 // Tests of control flow statements. |
| 7 | 7 |
| 8 library control_flow_tests; | 8 library control_flow_tests; |
| 9 | 9 |
| 10 import 'js_backend_cps_ir.dart'; | 10 import 'js_backend_cps_ir.dart'; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 foo(a) => a; | 50 foo(a) => a; |
| 51 | 51 |
| 52 main() { | 52 main() { |
| 53 for (int i = 0; foo(true); i = foo(i)) { | 53 for (int i = 0; foo(true); i = foo(i)) { |
| 54 print(1); | 54 print(1); |
| 55 if (foo(false)) break; | 55 if (foo(false)) break; |
| 56 } | 56 } |
| 57 print(2); | 57 print(2); |
| 58 }""", """ | 58 }""", """ |
| 59 function() { | 59 function() { |
| 60 var i; | 60 var i = 0; |
| 61 i = 0; | |
| 62 L1: | 61 L1: |
| 63 while (true) { | 62 while (true) { |
| 64 if (P.identical(V.foo(true), true)) { | 63 if (P.identical(V.foo(true), true)) { |
| 65 P.print(1); | 64 P.print(1); |
| 66 if (!P.identical(V.foo(false), true)) { | 65 if (!P.identical(V.foo(false), true)) { |
| 67 i = V.foo(i); | 66 i = V.foo(i); |
| 68 continue L1; | 67 continue L1; |
| 69 } | 68 } |
| 70 } | 69 } |
| 71 P.print(2); | 70 P.print(2); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 function() { | 135 function() { |
| 137 V.foo(); | 136 V.foo(); |
| 138 P.print("good"); | 137 P.print("good"); |
| 139 return null; | 138 return null; |
| 140 }"""), | 139 }"""), |
| 141 ]; | 140 ]; |
| 142 | 141 |
| 143 void main() { | 142 void main() { |
| 144 runTests(tests); | 143 runTests(tests); |
| 145 } | 144 } |
| OLD | NEW |