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

Unified Diff: test/cctest/compiler/test-js-typed-lowering.cc

Issue 533103002: Fix typed lowering of JSToBoolean on number inputs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Extend test to cover this case. Created 6 years, 3 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/js-typed-lowering.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-js-typed-lowering.cc
diff --git a/test/cctest/compiler/test-js-typed-lowering.cc b/test/cctest/compiler/test-js-typed-lowering.cc
index 0bee87ac83e729d9cf0928291667f8b010f377f6..9d0d720d26afba20504d5992f101ad83a7872464 100644
--- a/test/cctest/compiler/test-js-typed-lowering.cc
+++ b/test/cctest/compiler/test-js-typed-lowering.cc
@@ -506,7 +506,8 @@ TEST(JSToBoolean) {
TEST(JSToBoolean_replacement) {
JSTypedLoweringTester R;
- Type* types[] = {Type::Null(), Type::Undefined(), Type::Boolean(),
+ Type* types[] = {Type::Null(), Type::Undefined(),
+ Type::Boolean(), Type::Number(),
Type::DetectableObject(), Type::Undetectable()};
for (size_t i = 0; i < arraysize(types); i++) {
@@ -521,6 +522,8 @@ TEST(JSToBoolean_replacement) {
if (types[i]->Is(Type::Boolean())) {
CHECK_EQ(n, r);
+ } else if (types[i]->Is(Type::Number())) {
+ CHECK_EQ(IrOpcode::kBooleanNot, r->opcode());
titzer 2014/09/03 11:24:49 Check it's actually BooleanNot(NumberEqual(x, 0))
Michael Starzinger 2014/09/03 11:33:00 As discussed offline: This is already checked in t
} else {
CHECK_EQ(IrOpcode::kHeapConstant, r->opcode());
}
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698