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

Unified Diff: tests/language/arithmetic_test.dart

Issue 140233002: Fix issue 16103 (VM crash): incorrect merging of sin/cos. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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/flow_graph_optimizer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/arithmetic_test.dart
===================================================================
--- tests/language/arithmetic_test.dart (revision 31855)
+++ tests/language/arithmetic_test.dart (working copy)
@@ -435,10 +435,15 @@
static double sinCosSub(double a) => sin(a) - cos(a);
+ static double sinCosAddCos(double a) => sin(a) * cos(a) + cos(a);
+
static void testSinCos() {
var e = sin(1.234) - cos(1.234);
+ var f = sin(1.234) * cos(1.234) + cos(1.234);
+
for (var i = 0; i < 20; i++) {
Expect.approxEquals(e, sinCosSub(1.234));
+ Expect.approxEquals(f, sinCosAddCos(1.234));
}
Expect.approxEquals(1.0, sinCosSub(3.14159265));
Expect.approxEquals(1.0, sinCosSub(3.14159265 / 2.0));
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698