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

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

Issue 2772143002: Reland "VM: Handle null-comparisons in the flow graph type propagation" (Closed)
Patch Set: address comments Created 3 years, 9 months 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 | « tests/language/vm/integer_type_propagation2_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/vm/integer_type_propagation_test.dart
diff --git a/tests/language/vm/integer_type_propagation_test.dart b/tests/language/vm/integer_type_propagation_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..3b33750d4f73f0efa9e03afc51042173d35a4192
--- /dev/null
+++ b/tests/language/vm/integer_type_propagation_test.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2017, 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=--checked --enable-inlining-annotations --no-background-compilation --optimization-counter-threshold=1000
+
+import "package:expect/expect.dart";
+
+const noInline = "NeverInline";
+
+@noInline
+testuint32(y) {
+ int x = y;
+ if (x != null) {
+ return x & 0xffff;
+ }
+}
+
+main() {
+ var s = 0;
+ testuint32(0x7fffffff);
+ for (int i = 0; i < 10000; ++i) {
+ testuint32(i);
+ }
+ Expect.equals(65535, testuint32(0x7fffffff));
+ Expect.equals(65535, testuint32(0x7fff23452435245ffff));
+}
« no previous file with comments | « tests/language/vm/integer_type_propagation2_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698