OLD | NEW |
| (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 int if1() { | |
6 if (true) { | |
7 return 499; | |
8 } | |
9 return 3; | |
10 } | |
11 | |
12 int if2() { | |
13 if (true) { | |
14 return 499; | |
15 } | |
16 } | |
17 | |
18 int if3() { | |
19 if (false) { | |
20 return 42; | |
21 } else { | |
22 if (true) { | |
23 return 499; | |
24 } | |
25 Expect.fail('unreachable'); | |
26 } | |
27 } | |
28 | |
29 int if4() { | |
30 if (true) { | |
31 return 499; | |
32 } else { | |
33 return 42; | |
34 } | |
35 } | |
36 | |
37 int if5() { | |
38 if (true) { | |
39 if (false) return 42; | |
40 } else { | |
41 } | |
42 return 499; | |
43 } | |
44 | |
45 int if6() { | |
46 if (true) { | |
47 if (false) return 42; | |
48 } | |
49 return 499; | |
50 } | |
51 | |
52 void main() { | |
53 Expect.equals(499, if1()); | |
54 Expect.equals(499, if2()); | |
55 Expect.equals(499, if3()); | |
56 Expect.equals(499, if4()); | |
57 Expect.equals(499, if5()); | |
58 Expect.equals(499, if6()); | |
59 } | |
OLD | NEW |