| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 | 4 |
| 5 // Test that the GVN optimization pass works as expected. | 5 // Test that the GVN optimization pass works as expected. |
| 6 | 6 |
| 7 library basic_tests; | 7 library gvn_tests; |
| 8 | 8 |
| 9 import 'js_backend_cps_ir.dart'; | 9 import 'js_backend_cps_ir.dart'; |
| 10 | 10 |
| 11 const List<TestEntry> tests = const [ | 11 const List<TestEntry> tests = const [ |
| 12 const TestEntry(r""" | 12 const TestEntry(r""" |
| 13 foo(x, list) { | 13 foo(x, list) { |
| 14 var sum = 0; | 14 var sum = 0; |
| 15 for (int k = 0; k < 10; k++) { | 15 for (int k = 0; k < 10; k++) { |
| 16 // Everything can be hoisted out up to the index access which is | 16 // Everything can be hoisted out up to the index access which is |
| 17 // blocked by the bounds check. | 17 // blocked by the bounds check. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 if (!(typeof print == "function")) | 68 if (!(typeof print == "function")) |
| 69 throw "Unable to print message: " + String(v0); | 69 throw "Unable to print message: " + String(v0); |
| 70 print(v0); | 70 print(v0); |
| 71 } | 71 } |
| 72 }"""), | 72 }"""), |
| 73 ]; | 73 ]; |
| 74 | 74 |
| 75 void main() { | 75 void main() { |
| 76 runTests(tests); | 76 runTests(tests); |
| 77 } | 77 } |
| OLD | NEW |