Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1189)

Unified Diff: tests/language/vm/optimized_list_constructor_test.dart

Issue 2490803002: DBC: Fix bugs with array allocation (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/simulator_dbc.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/vm/optimized_list_constructor_test.dart
diff --git a/tests/language/vm/optimized_list_constructor_test.dart b/tests/language/vm/optimized_list_constructor_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..a6e27ce15769150c5ed9bca24d02a3b584808eee
--- /dev/null
+++ b/tests/language/vm/optimized_list_constructor_test.dart
@@ -0,0 +1,26 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// Test various optimizations and deoptimizations of optimizing compiler..
+// VMOptions=--optimization-counter-threshold=10 --no-background-compilation
+
+import "package:expect/expect.dart";
+
+// Test correct throwing of ArgumentError in optimized code.
+
+test() {
+ try {
+ var r = new List<int>(-1);
+ Expect.isTrue(false); // Unreachable.
+ } on RangeError {
+ return true;
+ }
+ Expect.isTrue(false); // Unreachable.
+}
+
+main() {
+ for (var i = 0; i < 20; i++) {
+ Expect.isTrue(test());
+ }
+}
+
« no previous file with comments | « runtime/vm/simulator_dbc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698