| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 import 'compiler_helper.dart'; | 6 import 'compiler_helper.dart'; |
| 7 | 7 |
| 8 const int REMOVED = 0; | 8 const int REMOVED = 0; |
| 9 const int ABOVE_ZERO = 1; | 9 const int ABOVE_ZERO = 1; |
| 10 const int BELOW_LENGTH = 2; | 10 const int BELOW_LENGTH = 2; |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 return sum; | 153 return sum; |
| 154 } | 154 } |
| 155 """, | 155 """, |
| 156 REMOVED, | 156 REMOVED, |
| 157 | 157 |
| 158 """ | 158 """ |
| 159 main(value) { | 159 main(value) { |
| 160 // Force [value] to be an int by having the speculative optimizer | 160 // Force [value] to be an int by having the speculative optimizer |
| 161 // want an int. | 161 // want an int. |
| 162 int sum = 0; | 162 int sum = 0; |
| 163 for (int i = 0; i < 42; i++) sum += (value & 4); | 163 for (int i = 0; i < 42; i++) sum += ~value; |
| 164 var a = new List(); | 164 var a = new List(); |
| 165 if (value > a.length - 1) return; | 165 if (value > a.length - 1) return; |
| 166 if (value < 0) return; | 166 if (value < 0) return; |
| 167 return a[value]; | 167 return a[value]; |
| 168 } | 168 } |
| 169 """, | 169 """, |
| 170 REMOVED, | 170 REMOVED, |
| 171 | 171 |
| 172 """ | 172 """ |
| 173 main(value) { | 173 main(value) { |
| 174 // Force [value] to be an int by having the speculative optimizer | 174 // Force [value] to be an int by having the speculative optimizer |
| 175 // want an int. | 175 // want an int. |
| 176 int sum = 0; | 176 int sum = 0; |
| 177 for (int i = 0; i < 42; i++) sum += (value & 4); | 177 for (int i = 0; i < 42; i++) sum += ~value; |
| 178 var a = new List(); | 178 var a = new List(); |
| 179 if (value <= a.length - 1) { | 179 if (value <= a.length - 1) { |
| 180 if (value >= 0) { | 180 if (value >= 0) { |
| 181 return a[value]; | 181 return a[value]; |
| 182 } | 182 } |
| 183 } | 183 } |
| 184 } | 184 } |
| 185 """, | 185 """, |
| 186 REMOVED, | 186 REMOVED, |
| 187 """ | 187 """ |
| 188 main(value) { | 188 main(value) { |
| 189 // Force [value] to be an int by having the speculative optimizer | 189 // Force [value] to be an int by having the speculative optimizer |
| 190 // want an int. | 190 // want an int. |
| 191 int sum = 0; | 191 int sum = 0; |
| 192 for (int i = 0; i < 42; i++) sum += (value & 4); | 192 for (int i = 0; i < 42; i++) sum += ~value; |
| 193 var a = new List(); | 193 var a = new List(); |
| 194 if (value >= a.length) return; | 194 if (value >= a.length) return; |
| 195 if (value <= -1) return; | 195 if (value <= -1) return; |
| 196 return a[value]; | 196 return a[value]; |
| 197 } | 197 } |
| 198 """, | 198 """, |
| 199 REMOVED, | 199 REMOVED, |
| 200 ]; | 200 ]; |
| 201 | 201 |
| 202 // TODO(ahe): It would probably be better if this test used the real | 202 // TODO(ahe): It would probably be better if this test used the real |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 operator <<(other) {} | 246 operator <<(other) {} |
| 247 operator >>(other) {} | 247 operator >>(other) {} |
| 248 operator |(other) {} | 248 operator |(other) {} |
| 249 operator &(other) {} | 249 operator &(other) {} |
| 250 operator ^(other) {} | 250 operator ^(other) {} |
| 251 operator <(other) {} | 251 operator <(other) {} |
| 252 operator >(other) {} | 252 operator >(other) {} |
| 253 operator <=(other) {} | 253 operator <=(other) {} |
| 254 operator >=(other) {} | 254 operator >=(other) {} |
| 255 operator ==(other) {} | 255 operator ==(other) {} |
| 256 operator~() {} |
| 256 } | 257 } |
| 257 class JSInt extends JSNumber { | 258 class JSInt extends JSNumber { |
| 258 } | 259 } |
| 259 class JSDouble extends JSNumber { | 260 class JSDouble extends JSNumber { |
| 260 } | 261 } |
| 261 class JSNull { | 262 class JSNull { |
| 262 } | 263 } |
| 263 class JSBool { | 264 class JSBool { |
| 264 } | 265 } |
| 265 class JSFunction { | 266 class JSFunction { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 break; | 307 break; |
| 307 } | 308 } |
| 308 } | 309 } |
| 309 | 310 |
| 310 | 311 |
| 311 main() { | 312 main() { |
| 312 for (int i = 0; i < TESTS.length; i += 2) { | 313 for (int i = 0; i < TESTS.length; i += 2) { |
| 313 expect(TESTS[i], TESTS[i + 1]); | 314 expect(TESTS[i], TESTS[i + 1]); |
| 314 } | 315 } |
| 315 } | 316 } |
| OLD | NEW |