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

Side by Side Diff: tests/language/arithmetic_test.dart

Issue 16853005: Fix bug in constant propagation with double-equality. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 // Dart test program to test arithmetic operations. 4 // Dart test program to test arithmetic operations.
5 5
6 library arithmetic_test; 6 library arithmetic_test;
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 import 'dart:math'; 8 import 'dart:math';
9 9
10 class ArithmeticTest { 10 class ArithmeticTest {
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 } 428 }
429 429
430 static mySqrt(var x) => sqrt(x); 430 static mySqrt(var x) => sqrt(x);
431 431
432 static testSqrtDeopt() { 432 static testSqrtDeopt() {
433 for (var i = 0; i < 10; i++) mySqrt(4.0); 433 for (var i = 0; i < 10; i++) mySqrt(4.0);
434 Expect.equals(2.0, mySqrt(4.0)); 434 Expect.equals(2.0, mySqrt(4.0));
435 Expect.throws(() => mySqrt("abc")); 435 Expect.throws(() => mySqrt("abc"));
436 } 436 }
437 437
438 static self_equality(x) {
439 return x == x;
440 }
441
442 static testDoubleEquality() {
443 Expect.isFalse(self_equality(double.NAN));
444 for (int i = 0; i < 2000; i++) {
445 self_equality(3.0);
446 }
447 Expect.isFalse(self_equality(double.NAN));
448 }
449
438 static testMain() { 450 static testMain() {
439 for (int i = 0; i < 1500; i++) { 451 for (int i = 0; i < 1500; i++) {
440 runOne(); 452 runOne();
441 testSmiDivDeopt(); 453 testSmiDivDeopt();
442 testSqrtDeopt(); 454 testSqrtDeopt();
455 testDoubleEquality();
443 } 456 }
444 } 457 }
445 } 458 }
446 459
447 main() { 460 main() {
448 ArithmeticTest.testMain(); 461 ArithmeticTest.testMain();
449 } 462 }
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698