| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // VMOptions=--optimization-counter-threshold=10 |
| 5 |
| 6 import "package:expect/expect.dart"; |
| 7 |
| 8 // Test correct dead phi elimination with try catch. |
| 9 |
| 10 List<Object> a = [1,2,3,4,5]; |
| 11 |
| 12 class MyError { } |
| 13 |
| 14 class M { |
| 15 maythrow(i) { |
| 16 try { |
| 17 if (i <= 5) throw new MyError(); |
| 18 } catch(e) { throw e; } |
| 19 } |
| 20 } |
| 21 |
| 22 loop_test() { |
| 23 bool failed = false; |
| 24 M m = new M(); |
| 25 for (Object i in a) { |
| 26 try { |
| 27 String res = m.maythrow(i); |
| 28 failed = true; |
| 29 } on MyError catch(e) { } |
| 30 if (!identical(failed, false)) { |
| 31 Expect.fail(""); |
| 32 } |
| 33 } |
| 34 } |
| 35 |
| 36 main() { |
| 37 for (var i = 0; i < 20; i++) loop_test(); |
| 38 } |
| 39 |
| 40 |
| 41 |
| OLD | NEW |