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

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

Issue 737353002: cps-ir: Implement boolean conversion in and use it to implement '&&', '||', and '?:'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase to new test infrastructure. Created 6 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 | « pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart ('k') | tests/compiler/dart2js/js_backend_cps_ir_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/js_backend_cps_ir_operators.dart
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_operators.dart b/tests/compiler/dart2js/js_backend_cps_ir_operators.dart
new file mode 100644
index 0000000000000000000000000000000000000000..3cdcf9b99d418ea3f7865cbf59b66f5c78f715e3
--- /dev/null
+++ b/tests/compiler/dart2js/js_backend_cps_ir_operators.dart
@@ -0,0 +1,45 @@
+// Copyright (c) 2014, 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.
+
+// Tests of operators.
+
+library operators_tests;
+
+import 'js_backend_cps_ir_test.dart';
+
+const List<TestEntry> tests = const [
+ const TestEntry("main() { return true ? 42 : 'foo'; }"),
+ const TestEntry("""
+foo() => foo;
+main() {
+ print(foo() ? "hello world" : "bad bad");
+}""",
+"""function() {
+ P.print(P.identical(V.foo(), true) ? "hello world" : "bad bad");
+ return null;
+}"""),
+ const TestEntry("""
+get foo => foo;
+main() {
+ print(foo ? "hello world" : "bad bad");
+}""",
+"""function() {
+ P.print(P.identical(V.foo(), true) ? "hello world" : "bad bad");
+ return null;
+}"""),
+ const TestEntry("""
+get foo => foo;
+main() { print(foo && foo); }""",
+"""function() {
+ P.print(P.identical(V.foo(), true) && P.identical(V.foo(), true));
+ return null;
+}"""),
+ const TestEntry("""
+get foo => foo;
+main() { print(foo || foo); }""",
+"""function() {
+ P.print(P.identical(V.foo(), true) || P.identical(V.foo(), true));
+ return null;
+}"""),
+];
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart ('k') | tests/compiler/dart2js/js_backend_cps_ir_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698