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

Side by Side Diff: tests/language/vm/optimized_testsmi_test.dart

Issue 78733002: Generalize if-conversion to arbitrary smi comparisons. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « tests/language/vm/if_conversion_vm_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4 // VMOptions=--optimization_counter_threshold=10
5
6 // Test branch optimization for TestSmiInstr
7
8 import "package:expect/expect.dart";
9
10 test(bool b) {
11 var a = 0;
12 if (b) {
13 a++;
14 } else {
15 a += 2;
16 }
17 if (a & 1 == 0) {
18 return "even";
19 }
20 return "odd";
21 }
22
23 main() {
24 Expect.equals("odd", test(true));
25 Expect.equals("even", test(false));
26 for (var i=0; i<20; i++) test(false);
27 Expect.equals("odd", test(true));
28 Expect.equals("even", test(false));
29 }
30
OLDNEW
« no previous file with comments | « tests/language/vm/if_conversion_vm_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698