OLD | NEW |
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 // Test if-convertion pass in the optimizing compiler. | 5 // Test if-convertion pass in the optimizing compiler. |
6 // VMOptions=--optimization-counter-threshold=10 --no-use-osr | 6 // VMOptions=--optimization-counter-threshold=10 --no-use-osr --no-background-co
mpilation |
7 | 7 |
8 import "package:expect/expect.dart"; | 8 import "package:expect/expect.dart"; |
9 | 9 |
10 f1(i) => (i == 0) ? 0 : 1; | 10 f1(i) => (i == 0) ? 0 : 1; |
11 f2(i) => (i == 0) ? 2 : 3; | 11 f2(i) => (i == 0) ? 2 : 3; |
12 f3(i) => (i == null) ? 0 : 1; | 12 f3(i) => (i == null) ? 0 : 1; |
13 f4(i) => (i == null) ? 2 : 3; | 13 f4(i) => (i == null) ? 2 : 3; |
14 | 14 |
15 f5(i) => (i != 0) ? 0 : 1; | 15 f5(i) => (i != 0) ? 0 : 1; |
16 f6(i) => (i != 0) ? 2 : 3; | 16 f6(i) => (i != 0) ? 2 : 3; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 Expect.equals(0, f24(0)); | 144 Expect.equals(0, f24(0)); |
145 Expect.equals(1, f24(-1)); | 145 Expect.equals(1, f24(-1)); |
146 | 146 |
147 Expect.equals(0, f25(-1)); | 147 Expect.equals(0, f25(-1)); |
148 Expect.equals(1, f25(0)); | 148 Expect.equals(1, f25(0)); |
149 | 149 |
150 Expect.equals(0, f26(0)); | 150 Expect.equals(0, f26(0)); |
151 Expect.equals(1, f26(1)); | 151 Expect.equals(1, f26(1)); |
152 } | 152 } |
OLD | NEW |