| 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);
|
| + });
|
| + });
|
| +}
|
|
|