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

Side by Side Diff: tests/language/range_analysis3_test.dart

Issue 1518553002: Use annotations on confuse() functions (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years 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
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 6
7 confuse(x) { 7 @NoInline() @AssumeDynamic()
floitsch 2015/12/09 20:40:15 Actually the confuse here was still making sure th
8 if (new DateTime.now().millisecondsSinceEpoch == 0) { 8 confuse(x) => x;
9 return confuse(x + 1);
10 } else if (new DateTime.now().millisecondsSinceEpoch == 0) {
11 return confuse(x - 1);
12 }
13 return x;
14 }
15 9
16 test1() { 10 test1() {
17 int x = 0; 11 int x = 0;
18 // Give x a range of -1 to 0. 12 // Give x a range of -1 to 0.
19 if (confuse(0) == 1) x = -1; 13 if (confuse(0) == 1) x = -1;
20 14
21 int y = 0; 15 int y = 0;
22 // Give y a range of 0 to 1. 16 // Give y a range of 0 to 1.
23 if (confuse(0) == 1) y = 1; 17 if (confuse(0) == 1) y = 1;
24 18
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 Expect.equals("good", status); 194 Expect.equals("good", status);
201 } 195 }
202 196
203 main() { 197 main() {
204 test1(); 198 test1();
205 test2(); 199 test2();
206 test3a(); 200 test3a();
207 test3b(); 201 test3b();
208 test4a(); 202 test4a();
209 test4b(); 203 test4b();
210 } 204 }
OLDNEW
« tests/language/const_map2_test.dart ('K') | « tests/language/const_map_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698