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

Unified Diff: tests/language/vm/if_conversion_vm_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, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | tests/language/vm/optimized_testsmi_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/vm/if_conversion_vm_test.dart
===================================================================
--- tests/language/vm/if_conversion_vm_test.dart (revision 30464)
+++ tests/language/vm/if_conversion_vm_test.dart (working copy)
@@ -42,6 +42,15 @@
f19(i) => i == 0 ? 0 : 0;
+f20(i) => i > 0 ? 0 : 1;
+f21(i) => i > 0 ? 2 : 3;
+f22(i) => i & 1 == 0 ? 0 : 1;
+f23(i) => i & 1 != 0 ? 1 : 0;
+
+f24(i) => i >= 0 ? 0 : 1;
+f25(i) => i < 0 ? 0 : 1;
+f26(i) => i <= 0 ? 0 : 1;
+
main() {
for (var i = 0; i < 20; i++) {
f1(i);
@@ -65,6 +74,13 @@
f17(true);
f18(true);
f19(i);
+ f20(i);
+ f21(i);
+ f22(i);
+ f23(i);
+ f24(i);
+ f25(i);
+ f26(i);
}
Expect.equals(0, f1(0));
@@ -117,4 +133,20 @@
Expect.equals(0, f19(0));
Expect.equals(0, f19(1));
+
+ Expect.equals(0, f20(123));
+ Expect.equals(2, f21(123));
+ Expect.equals(0, f22(122));
+ Expect.equals(1, f22(123));
+ Expect.equals(0, f23(122));
+ Expect.equals(1, f23(123));
+
+ Expect.equals(0, f24(0));
+ Expect.equals(1, f24(-1));
+
+ Expect.equals(0, f25(-1));
+ Expect.equals(1, f25(0));
+
+ Expect.equals(0, f26(0));
+ Expect.equals(1, f26(1));
}
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | tests/language/vm/optimized_testsmi_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698