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

Side by Side Diff: frog/tests/leg_only/while_test.dart

Issue 10536169: Move frog/tests/{leg,leg_only,frog_native} to tests/compiler/. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
(Empty)
1 // Copyright (c) 2011, 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 void while1() {
6 bool cond = true;
7 var result = 0;
8 var x = 0;
9 while (cond) {
10 if (x == 10) cond = false;
11 result += x;
12 x = x + 1;
13 }
14 Expect.equals(55, result);
15 }
16
17 void while2() {
18 var t = 0;
19 var i = 0;
20 while (i == 0) {
21 t = t + 10;
22 i++;
23 }
24 Expect.equals(10, t);
25 }
26
27 void while3() {
28 var i = 0;
29 while (i == 1) {
30 Expect.fail('unreachable');
31 }
32 }
33
34 void while4() {
35 var cond1 = true;
36 var result = 0;
37 var i = 0;
38 while (cond1) {
39 if (i == 9) cond1 = false;
40 var cond2 = true;
41 var j = 0;
42 while (cond2) {
43 if (j == 9) cond2 = false;
44 result = result + 1;
45 j = j + 1;
46 }
47 i = i + 1;
48 }
49 Expect.equals(100, result);
50 }
51
52 int while5_2() {
53 // The while condition dominates 3 blocks: the body, the block after the loop
54 // and the exit block.
55 while (true) {
56 if (true) {
57 return 499;
58 }
59 }
60 return 0;
61 }
62
63 void while5() {
64 Expect.equals(499, while5_2());
65 }
66
67 void main() {
68 while1();
69 while2();
70 while3();
71 while4();
72 while5();
73 }
OLDNEW
« no previous file with comments | « frog/tests/leg_only/variable_type_test.dart ('k') | lib/compiler/implementation/native_handler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698