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

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: Use the right inputs. 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
Index: tests/compiler/dart2js/inverse_operator_test.dart
diff --git a/tests/compiler/dart2js/inverse_operator_test.dart b/tests/compiler/dart2js/inverse_operator_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..e722d8da9e05dd11804ad5862ae789c89808b34a
--- /dev/null
+++ b/tests/compiler/dart2js/inverse_operator_test.dart
@@ -0,0 +1,24 @@
+// Copyright (c) 2012, 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.
+
+#import("compiler_helper.dart");
+
+const String MAIN = r"""
+main() {
+ foo(x) {
+ if (x == 0) return x;
floitsch 2012/10/04 11:35:26 this will be too easy to inline. Maybe change to:
+ return x;
+ }
+ var x = 1;
+ if (foo(x) == 0) {
+ x = 2;
+ }
+ print(!(1 < x));
+}""";
+
+main() {
+ // Make sure we don't introduce a new variable.
+ RegExp regexp = new RegExp("1 >= x");
+ compileAndMatch(MAIN, 'main', regexp);
+}
« lib/compiler/implementation/ssa/codegen.dart ('K') | « lib/compiler/implementation/ssa/codegen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698