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

Unified Diff: tests/language/if_conversion_vm_test.dart

Issue 13884009: Support IfThenElse instruction pattern for arbitrary smi constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 months 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/if_conversion_vm_test.dart
diff --git a/tests/language/if_conversion_vm_test.dart b/tests/language/if_conversion_vm_test.dart
index 22e6203291f96ac6251f204399738b29cf7f2be9..8fc82e2babaca09cf65c78dda56166ee767d567b 100644
--- a/tests/language/if_conversion_vm_test.dart
+++ b/tests/language/if_conversion_vm_test.dart
@@ -30,6 +30,12 @@ const POWER_OF_2 = 0x1000000000;
bigPower(i) => (i == 11) ? 0 : POWER_OF_2;
+cse(i) {
+ final a = i == 0 ? 0 : 1;
+ final b = i == 0 ? 2 : 3;
+ return a + b;
+}
+
main() {
for (var i = 0; i < 10000; i++) {
f1(i);
@@ -48,6 +54,7 @@ main() {
f14(i);
f15(i);
f16(i);
+ cse(i);
bigPower(i);
}
@@ -89,4 +96,7 @@ main() {
Expect.equals(0, bigPower(11));
Expect.equals(POWER_OF_2, bigPower(12));
+
+ Expect.equals(2, cse(0));
+ Expect.equals(4, cse(1));
}
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698