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

Unified Diff: tests/compiler/dart2js/kernel/control_flow_test.dart

Issue 2301293002: kernel -> ssa: implement if-statements (Closed)
Patch Set: add visitNot Created 4 years, 3 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 | « tests/compiler/dart2js/dart2js.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/kernel/control_flow_test.dart
diff --git a/tests/compiler/dart2js/kernel/control_flow_test.dart b/tests/compiler/dart2js/kernel/control_flow_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..c6ffe844a49ce4a95e9cf14921c4a4b9c9726f64
--- /dev/null
+++ b/tests/compiler/dart2js/kernel/control_flow_test.dart
@@ -0,0 +1,41 @@
+// Copyright (c) 2016, 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 'package:test/test.dart';
+
+import 'helper.dart' show check;
+
+main() {
+ group('compile control flow', () {
+ test('simple if statement', () {
+ String code = '''
+ main() {
+ if (true) {
+ return 1;
+ } else {
+ return 2;
+ }
+ }''';
+ return check(code);
+ });
+ test('simple if statement no else', () {
+ String code = '''
+ main() {
+ if (true) {
+ return 1;
+ }
+ }''';
+ return check(code);
+ });
+ test('simple dead if statement', () {
+ String code = '''
+ main() {
+ if (false) {
+ return 1;
+ }
+ }''';
+ return check(code);
+ });
+ });
+}
« no previous file with comments | « tests/compiler/dart2js/dart2js.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698