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

Unified Diff: tests/compiler/dart2js/inverse_operator_test.dart

Issue 11065007: Use the correct inputs when checking if inverse operator can be used. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: !isDouble is not enough, because we could infer num for a NaN. Created 8 years, 2 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 | « lib/compiler/implementation/ssa/codegen.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/inverse_operator_test.dart
diff --git a/tests/language/infinity_test.dart b/tests/compiler/dart2js/inverse_operator_test.dart
similarity index 51%
copy from tests/language/infinity_test.dart
copy to tests/compiler/dart2js/inverse_operator_test.dart
index 7ac9f31ad0b9bf555adadd61800eb8b8f93df683..df3da803c0b9c6848fec1968e8aaa6a45a29095d 100644
--- a/tests/language/infinity_test.dart
+++ b/tests/compiler/dart2js/inverse_operator_test.dart
@@ -2,14 +2,20 @@
// 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.
+#import("compiler_helper.dart");
+
+const String MAIN = r"""
int inscrutable(int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1));
+main() {
+ var x = 1;
+ if (inscrutable(x) == 0) {
+ x = 2;
+ }
+ print(!(1 < x));
+}""";
main() {
- var things = [0, double.INFINITY, double.NEGATIVE_INFINITY];
- var first = things[1];
- var second = things[2];
- Expect.isFalse(first is int);
- Expect.isFalse(second is int);
- Expect.isTrue(first is double);
- Expect.isTrue(second is double);
+ // Make sure we don't introduce a new variable.
+ RegExp regexp = new RegExp("1 >= x");
+ compileAndMatch(MAIN, 'main', regexp);
}
« no previous file with comments | « lib/compiler/implementation/ssa/codegen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698