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

Unified Diff: test/unittests/compiler/typer-unittest.cc

Issue 2739573004: [turbofan] Extend optimization of flooring integer division. (Closed)
Patch Set: Address offline feedback. Created 3 years, 9 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 | « src/compiler/typed-optimization.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/typer-unittest.cc
diff --git a/test/unittests/compiler/typer-unittest.cc b/test/unittests/compiler/typer-unittest.cc
index d30cc8e48883e4cd311821af84fb529ffae5e828..dd85b55e8161edb4370f2d83564d0d87e5a6526c 100644
--- a/test/unittests/compiler/typer-unittest.cc
+++ b/test/unittests/compiler/typer-unittest.cc
@@ -165,6 +165,16 @@ class TyperTest : public TypedGraphTest {
EXPECT_TRUE(result_type->Is(expected_type));
}
}
+ // Test extreme cases.
+ double x1 = +1e-308;
+ double x2 = -1e-308;
+ Type* r1 = Type::NewConstant(isolate()->factory()->NewNumber(x1), zone());
+ Type* r2 = Type::NewConstant(isolate()->factory()->NewNumber(x2), zone());
+ Type* expected_type = TypeBinaryOp(op, r1, r2);
+ double result_value = opfun(x1, x2);
+ Type* result_type = Type::NewConstant(
+ isolate()->factory()->NewNumber(result_value), zone());
+ EXPECT_TRUE(result_type->Is(expected_type));
}
template <class BinaryFunction>
« no previous file with comments | « src/compiler/typed-optimization.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698