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

Side by Side Diff: tests/compiler/dart2js/kernel/control_flow_test.dart

Issue 2301293002: kernel -> ssa: implement if-statements (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'package:test/test.dart';
6
7 import 'helper.dart' show check;
8
9 main() {
10 group('compile control flow', () {
11 test('simple if statement', () {
12 String code = '''
13 main() {
14 if (true) {
Siggi Cherem (dart-lang) 2016/09/01 23:51:22 does this generate the condition (or are we elimin
Harry Terkelsen 2016/09/02 17:52:28 we can't compile logical operators yet, but I will
15 return 1;
16 } else {
17 return 2;
18 }
19 }''';
20 return check(code);
21 });
22 test('simple if statement no else', () {
23 String code = '''
24 main() {
25 if (true) {
26 return 1;
27 }
28 }''';
29 return check(code);
30 });
31 test('simple dead if statement', () {
32 String code = '''
33 main() {
34 if (false) {
35 return 1;
36 }
37 }''';
38 return check(code);
39 });
40 });
41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698