Chromium Code Reviews| Index: tests/language/branch_canonicalization_test.dart |
| diff --git a/tests/language/branch_canonicalization_test.dart b/tests/language/branch_canonicalization_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9ff21541d9fd21eec0528bf57d9bb99f6b965aec |
| --- /dev/null |
| +++ b/tests/language/branch_canonicalization_test.dart |
| @@ -0,0 +1,23 @@ |
| +// 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. |
| +// Test that branch fusion correctly sets branch environment for comparisons |
| +// that require unboxing. |
| + |
| +barDouble(a, b) => a == b; |
| +fooDouble(a, b) => barDouble(a, b) ? 1 : 0; |
| + |
| +barMint(a, b) => a == b; |
| +fooMint(a, b) => barMint(a, b) ? 1 : 0; |
| + |
| +main () { |
| + final a = 1.0; |
| + final b = 1 << 62; |
| + for (var i = 0; i < 10000; i++) { |
| + Expect.equals(1, fooDouble(a, a)); |
| + Expect.equals(0, fooMint(b, 0)); |
|
Florian Schneider
2013/02/13 11:22:11
Thanks for adding the test. Do we have a test cove
|
| + } |
| +} |
| + |
| + |
| + |