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

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

Issue 64723002: VM: Fix identical comparisons with bigints. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: fixed MIPS Created 7 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/stub_code_x64.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/regress_14903_test.dart
===================================================================
--- tests/language/vm/regress_14903_test.dart (revision 0)
+++ tests/language/vm/regress_14903_test.dart (revision 0)
@@ -0,0 +1,31 @@
+// Copyright (c) 2013, 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.
+// VMOptions=--optimization-counter-threshold=10
+
+import "package:expect/expect.dart";
+
+// Test identical comparisons in optimized code. Registers must be preserved
+// when calling the runtime.
+
+cmp(a, b, c) {
+ var v = c + 1;
+ var w = v + 1;
+ var x = w + 1;
+ var y = x + 1;
+ var z = y + 1;
+ if (identical(a, b)) {
+ c++;
+ }
+ return c + v + w + x + y + z;
+}
+
+
+main() {
+ var big = 100000000000000000000000000000000000;
+ var before = cmp(big, big, 0);
+ Expect.equals(16, before);
+ for (var i = 0; i < 20; i++) cmp(big, big + 1, 0);
+ Expect.equals(before, cmp(big, big, 0));
+}
+
« no previous file with comments | « runtime/vm/stub_code_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698