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

Side by Side Diff: tests/compiler/dart2js/licm_test.dart

Issue 326913002: Make dart2js unittests async. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Check that we hoist instructions in a loop condition, even if that 5 // Check that we hoist instructions in a loop condition, even if that
6 // condition involves control flow. 6 // condition involves control flow.
7 7
8 import 'package:expect/expect.dart'; 8 import 'package:async_helper/async_helper.dart';
9
10 import 'compiler_helper.dart'; 9 import 'compiler_helper.dart';
11 10
12 const String TEST = ''' 11 const String TEST = '''
13 var a = [1]; 12 var a = [1];
14 13
15 main() { 14 main() {
16 int count = int.parse('42') == 42 ? 42 : null; 15 int count = int.parse('42') == 42 ? 42 : null;
17 for (int i = 0; i < count && i < a[0]; i++) { 16 for (int i = 0; i < count && i < a[0]; i++) {
18 print(i); 17 print(i);
19 } 18 }
20 a.removeLast(); 19 a.removeLast();
21 // Ensure we don't try to generate a bailout method based on a check 20 // Ensure we don't try to generate a bailout method based on a check
22 // of [count]. 21 // of [count].
23 count.removeLast(); 22 count.removeLast();
24 } 23 }
25 '''; 24 ''';
26 25
27 main() { 26 main() {
28 compileAndMatch(TEST, 'main', 27 asyncTest(() => compileAndMatch(TEST, 'main',
29 new RegExp('if \\(typeof count !== "number"\\)(.|\\n)*while')); 28 new RegExp('if \\(typeof count !== "number"\\)(.|\\n)*while')));
30 } 29 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/js_parser_test.dart ('k') | tests/compiler/dart2js/literal_list_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698