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

Unified Diff: runtime/tests/vm/dart/double_to_smi_test.dart

Issue 2162173002: DBC: Misc double instructions (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Make test deopt Created 4 years, 5 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 | « no previous file | runtime/vm/assembler_dbc_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/tests/vm/dart/double_to_smi_test.dart
diff --git a/runtime/tests/vm/dart/double_materialize_test.dart b/runtime/tests/vm/dart/double_to_smi_test.dart
similarity index 58%
copy from runtime/tests/vm/dart/double_materialize_test.dart
copy to runtime/tests/vm/dart/double_to_smi_test.dart
index 2cab01ca6be4925b8852ceff2b78fe231f1f502c..06d6139fb80ada70fc604e9b9aebb262836ad402 100644
--- a/runtime/tests/vm/dart/double_materialize_test.dart
+++ b/runtime/tests/vm/dart/double_to_smi_test.dart
@@ -6,18 +6,18 @@
import "package:expect/expect.dart";
-double f(double x, double five, dynamic y) {
- double z = x + five;
- var a = y + 5;
- return z + a.toDouble();
+int convert(dynamic d) {
+ return d.toInt();
}
-void main() {
- double x = 1.0;
- for (int i = 0; i < 1000; i++) {
- x = f(x, 5.0, i);
+main() {
+ double x = -100.0;
+ int count = 0;
+ while (x < 100.0) {
+ count = count + convert(x);
+ x = x + 0.5;
}
- x = f(x, 5.0, 1.0);
- Expect.equals(509512.0, x);
+ Expect.equals(-100, count);
+ count = convert(42);
+ Expect.equals(42, count);
}
-
« no previous file with comments | « no previous file | runtime/vm/assembler_dbc_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698