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

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

Issue 22871008: Compensate for the lack of code motion in licm. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/optimize.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 // Check that we hoist instructions in a loop condition, even if that
6 // condition involves control flow.
7
8 import 'package:expect/expect.dart';
9
10 import 'compiler_helper.dart';
11
12 const String TEST = '''
13 var a = [1];
14
15 main() {
16 int count = int.parse('42') == 42 ? 42 : null;
17 for (int i = 0; i < count && i < a[0]; i++) {
18 print(i);
19 }
20 a.removeLast();
21 // Ensure we don't try to generate a bailout method based on a check
22 // of [count].
23 count.removeLast();
24 }
25 ''';
26
27 main() {
28 String generated = compile(TEST, entry: 'main');
29 int checkIndex = generated.indexOf('if (count == null)');
karlklose 2013/08/15 12:58:02 Consider testing this with a regular expression li
ngeoffray 2013/08/15 13:55:29 Done.
30 int loopIndex = generated.indexOf('while (true)');
31 Expect.isTrue(checkIndex != -1);
32 Expect.isTrue(loopIndex != -1);
33 Expect.isTrue(checkIndex < loopIndex);
34 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/optimize.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698