OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016, 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 // Test various optimizations and deoptimizations of optimizing compiler.. |
| 5 // VMOptions=--optimization-counter-threshold=10 --no-background-compilation |
| 6 |
| 7 import "package:expect/expect.dart"; |
| 8 |
| 9 // Test correct throwing of ArgumentError in optimized code. |
| 10 |
| 11 test() { |
| 12 try { |
| 13 var r = new List<int>(-1); |
| 14 Expect.isTrue(false); // Unreachable. |
| 15 } on RangeError { |
| 16 return true; |
| 17 } |
| 18 Expect.isTrue(false); // Unreachable. |
| 19 } |
| 20 |
| 21 main() { |
| 22 for (var i = 0; i < 20; i++) { |
| 23 Expect.isTrue(test()); |
| 24 } |
| 25 } |
| 26 |
OLD | NEW |