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

Side by Side Diff: tests/compiler/dart2js/cps_ir/input/gvn_1.dart

Issue 1576093003: cpsir unittests: move all unittests into individual files and test runners. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 foo(x, list) {
2 var sum = 0;
3 for (int k = 0; k < 10; k++) {
4 // Everything can be hoisted out up to the index access which is
5 // blocked by the bounds check.
6 var a = x.left.left;
7 var b = x.left.right;
8 var c = x.right.left;
9 var d = x.right.right;
10 var i = a.value + c.value;
11 var j = b.value + d.value;
12 var z = list[i * j] + i;
13 sum += z;
14 }
15 return sum;
16 }
17 // Use a different class for each level in the tree, so type inference
18 // is not confused.
19 class Root {
20 Branch left, right;
21 Root(this.left, this.right);
22 }
23 class Branch {
24 Leaf left, right;
25 Branch(this.left, this.right);
26 }
27 class Leaf {
28 int value;
29 Leaf(this.value);
30 }
31 main() {
32 var x1 = new Leaf(1);
33 var x2 = new Leaf(10);
34 var x3 = new Leaf(20);
35 var x4 = new Leaf(-10);
36 var y1 = new Branch(x1, x2);
37 var y2 = new Branch(x3, x4);
38 var z = new Root(y1, y2);
39 print(foo(z, [1,2,3,4,5,6,7,8,9,10]));
40 }
41
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/cps_ir/input/control_flow_9.dart ('k') | tests/compiler/dart2js/cps_ir/input/interceptors_1.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698