Commit 21585d55 authored by paul.lind's avatar paul.lind Committed by Commit bot

Fix more -Wsign-compare bugs with GCC 4.9.2.

BUG=

Review URL: https://codereview.chromium.org/1167613004

Cr-Commit-Position: refs/heads/master@{#28798}
parent f9dd3446
......@@ -13392,7 +13392,7 @@ TEST(CreateDataProperty) {
CHECK(arr->CreateDataProperty(env.local(), 1, v8::Integer::New(isolate, 23))
.FromJust());
CHECK(!try_catch.HasCaught());
CHECK_EQ(2, arr->Length());
CHECK_EQ(2U, arr->Length());
v8::Local<v8::Value> val = arr->Get(env.local(), 1).ToLocalChecked();
CHECK(val->IsNumber());
CHECK_EQ(23.0, val->NumberValue(env.local()).FromJust());
......@@ -13495,7 +13495,7 @@ TEST(DefineOwnProperty) {
CHECK(arr->DefineOwnProperty(env.local(), v8_str("1"),
v8::Integer::New(isolate, 23)).FromJust());
CHECK(!try_catch.HasCaught());
CHECK_EQ(2, arr->Length());
CHECK_EQ(2U, arr->Length());
v8::Local<v8::Value> val = arr->Get(env.local(), 1).ToLocalChecked();
CHECK(val->IsNumber());
CHECK_EQ(23.0, val->NumberValue(env.local()).FromJust());
......@@ -21377,22 +21377,22 @@ TEST(Map) {
CHECK(map->IsObject());
CHECK(map->IsMap());
CHECK(map->GetPrototype()->StrictEquals(CompileRun("Map.prototype")));
CHECK_EQ(0, map->Size());
CHECK_EQ(0U, map->Size());
v8::Local<v8::Value> val = CompileRun("new Map([[1, 2], [3, 4]])");
CHECK(val->IsMap());
map = v8::Local<v8::Map>::Cast(val);
CHECK_EQ(2, map->Size());
CHECK_EQ(2U, map->Size());
v8::Local<v8::Array> contents = map->AsArray();
CHECK_EQ(4, contents->Length());
CHECK_EQ(4U, contents->Length());
CHECK_EQ(1, contents->Get(0).As<v8::Int32>()->Value());
CHECK_EQ(2, contents->Get(1).As<v8::Int32>()->Value());
CHECK_EQ(3, contents->Get(2).As<v8::Int32>()->Value());
CHECK_EQ(4, contents->Get(3).As<v8::Int32>()->Value());
map = v8::Map::FromArray(env.local(), contents).ToLocalChecked();
CHECK_EQ(2, map->Size());
CHECK_EQ(2U, map->Size());
// Odd lengths result in a null MaybeLocal.
contents = v8::Array::New(isolate, 41);
......@@ -21409,18 +21409,18 @@ TEST(Set) {
CHECK(set->IsObject());
CHECK(set->IsSet());
CHECK(set->GetPrototype()->StrictEquals(CompileRun("Set.prototype")));
CHECK_EQ(0, set->Size());
CHECK_EQ(0U, set->Size());
v8::Local<v8::Value> val = CompileRun("new Set([1, 2])");
CHECK(val->IsSet());
set = v8::Local<v8::Set>::Cast(val);
CHECK_EQ(2, set->Size());
CHECK_EQ(2U, set->Size());
v8::Local<v8::Array> keys = set->AsArray();
CHECK_EQ(2, keys->Length());
CHECK_EQ(2U, keys->Length());
CHECK_EQ(1, keys->Get(0).As<v8::Int32>()->Value());
CHECK_EQ(2, keys->Get(1).As<v8::Int32>()->Value());
set = v8::Set::FromArray(env.local(), keys).ToLocalChecked();
CHECK_EQ(2, set->Size());
CHECK_EQ(2U, set->Size());
}
......@@ -3511,24 +3511,24 @@ TEST(class_fmt) {
Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0);
USE(dummy);
// Expected double results.
CHECK_EQ(bit_cast<uint64_t>(t.dNegInf), 0x004);
CHECK_EQ(bit_cast<uint64_t>(t.dNegNorm), 0x008);
CHECK_EQ(bit_cast<uint64_t>(t.dNegSubnorm), 0x010);
CHECK_EQ(bit_cast<uint64_t>(t.dNegZero), 0x020);
CHECK_EQ(bit_cast<uint64_t>(t.dPosInf), 0x040);
CHECK_EQ(bit_cast<uint64_t>(t.dPosNorm), 0x080);
CHECK_EQ(bit_cast<uint64_t>(t.dPosSubnorm), 0x100);
CHECK_EQ(bit_cast<uint64_t>(t.dPosZero), 0x200);
CHECK_EQ(bit_cast<int64_t>(t.dNegInf), 0x004);
CHECK_EQ(bit_cast<int64_t>(t.dNegNorm), 0x008);
CHECK_EQ(bit_cast<int64_t>(t.dNegSubnorm), 0x010);
CHECK_EQ(bit_cast<int64_t>(t.dNegZero), 0x020);
CHECK_EQ(bit_cast<int64_t>(t.dPosInf), 0x040);
CHECK_EQ(bit_cast<int64_t>(t.dPosNorm), 0x080);
CHECK_EQ(bit_cast<int64_t>(t.dPosSubnorm), 0x100);
CHECK_EQ(bit_cast<int64_t>(t.dPosZero), 0x200);
// Expected float results.
CHECK_EQ(bit_cast<uint32_t>(t.fNegInf), 0x004);
CHECK_EQ(bit_cast<uint32_t>(t.fNegNorm), 0x008);
CHECK_EQ(bit_cast<uint32_t>(t.fNegSubnorm), 0x010);
CHECK_EQ(bit_cast<uint32_t>(t.fNegZero), 0x020);
CHECK_EQ(bit_cast<uint32_t>(t.fPosInf), 0x040);
CHECK_EQ(bit_cast<uint32_t>(t.fPosNorm), 0x080);
CHECK_EQ(bit_cast<uint32_t>(t.fPosSubnorm), 0x100);
CHECK_EQ(bit_cast<uint32_t>(t.fPosZero), 0x200);
CHECK_EQ(bit_cast<int32_t>(t.fNegInf), 0x004);
CHECK_EQ(bit_cast<int32_t>(t.fNegNorm), 0x008);
CHECK_EQ(bit_cast<int32_t>(t.fNegSubnorm), 0x010);
CHECK_EQ(bit_cast<int32_t>(t.fNegZero), 0x020);
CHECK_EQ(bit_cast<int32_t>(t.fPosInf), 0x040);
CHECK_EQ(bit_cast<int32_t>(t.fPosNorm), 0x080);
CHECK_EQ(bit_cast<int32_t>(t.fPosSubnorm), 0x100);
CHECK_EQ(bit_cast<int32_t>(t.fPosZero), 0x200);
}
}
......@@ -3825,88 +3825,88 @@ TEST(C_COND_FMT) {
test.fOp1 = 2.0;
test.fOp2 = 3.0;
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
CHECK_EQ(test.dF, 0);
CHECK_EQ(test.dUn, 0);
CHECK_EQ(test.dEq, 0);
CHECK_EQ(test.dUeq, 0);
CHECK_EQ(test.dOlt, 1);
CHECK_EQ(test.dUlt, 1);
CHECK_EQ(test.dOle, 1);
CHECK_EQ(test.dUle, 1);
CHECK_EQ(test.fF, 0);
CHECK_EQ(test.fUn, 0);
CHECK_EQ(test.fEq, 0);
CHECK_EQ(test.fUeq, 0);
CHECK_EQ(test.fOlt, 1);
CHECK_EQ(test.fUlt, 1);
CHECK_EQ(test.fOle, 1);
CHECK_EQ(test.fUle, 1);
CHECK_EQ(test.dF, 0U);
CHECK_EQ(test.dUn, 0U);
CHECK_EQ(test.dEq, 0U);
CHECK_EQ(test.dUeq, 0U);
CHECK_EQ(test.dOlt, 1U);
CHECK_EQ(test.dUlt, 1U);
CHECK_EQ(test.dOle, 1U);
CHECK_EQ(test.dUle, 1U);
CHECK_EQ(test.fF, 0U);
CHECK_EQ(test.fUn, 0U);
CHECK_EQ(test.fEq, 0U);
CHECK_EQ(test.fUeq, 0U);
CHECK_EQ(test.fOlt, 1U);
CHECK_EQ(test.fUlt, 1U);
CHECK_EQ(test.fOle, 1U);
CHECK_EQ(test.fUle, 1U);
test.dOp1 = std::numeric_limits<double>::max();
test.dOp2 = std::numeric_limits<double>::min();
test.fOp1 = std::numeric_limits<float>::min();
test.fOp2 = std::numeric_limits<float>::lowest();
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
CHECK_EQ(test.dF, 0);
CHECK_EQ(test.dUn, 0);
CHECK_EQ(test.dEq, 0);
CHECK_EQ(test.dUeq, 0);
CHECK_EQ(test.dOlt, 0);
CHECK_EQ(test.dUlt, 0);
CHECK_EQ(test.dOle, 0);
CHECK_EQ(test.dUle, 0);
CHECK_EQ(test.fF, 0);
CHECK_EQ(test.fUn, 0);
CHECK_EQ(test.fEq, 0);
CHECK_EQ(test.fUeq, 0);
CHECK_EQ(test.fOlt, 0);
CHECK_EQ(test.fUlt, 0);
CHECK_EQ(test.fOle, 0);
CHECK_EQ(test.fUle, 0);
CHECK_EQ(test.dF, 0U);
CHECK_EQ(test.dUn, 0U);
CHECK_EQ(test.dEq, 0U);
CHECK_EQ(test.dUeq, 0U);
CHECK_EQ(test.dOlt, 0U);
CHECK_EQ(test.dUlt, 0U);
CHECK_EQ(test.dOle, 0U);
CHECK_EQ(test.dUle, 0U);
CHECK_EQ(test.fF, 0U);
CHECK_EQ(test.fUn, 0U);
CHECK_EQ(test.fEq, 0U);
CHECK_EQ(test.fUeq, 0U);
CHECK_EQ(test.fOlt, 0U);
CHECK_EQ(test.fUlt, 0U);
CHECK_EQ(test.fOle, 0U);
CHECK_EQ(test.fUle, 0U);
test.dOp1 = std::numeric_limits<double>::lowest();
test.dOp2 = std::numeric_limits<double>::lowest();
test.fOp1 = std::numeric_limits<float>::max();
test.fOp2 = std::numeric_limits<float>::max();
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
CHECK_EQ(test.dF, 0);
CHECK_EQ(test.dUn, 0);
CHECK_EQ(test.dEq, 1);
CHECK_EQ(test.dUeq, 1);
CHECK_EQ(test.dOlt, 0);
CHECK_EQ(test.dUlt, 0);
CHECK_EQ(test.dOle, 1);
CHECK_EQ(test.dUle, 1);
CHECK_EQ(test.fF, 0);
CHECK_EQ(test.fUn, 0);
CHECK_EQ(test.fEq, 1);
CHECK_EQ(test.fUeq, 1);
CHECK_EQ(test.fOlt, 0);
CHECK_EQ(test.fUlt, 0);
CHECK_EQ(test.fOle, 1);
CHECK_EQ(test.fUle, 1);
CHECK_EQ(test.dF, 0U);
CHECK_EQ(test.dUn, 0U);
CHECK_EQ(test.dEq, 1U);
CHECK_EQ(test.dUeq, 1U);
CHECK_EQ(test.dOlt, 0U);
CHECK_EQ(test.dUlt, 0U);
CHECK_EQ(test.dOle, 1U);
CHECK_EQ(test.dUle, 1U);
CHECK_EQ(test.fF, 0U);
CHECK_EQ(test.fUn, 0U);
CHECK_EQ(test.fEq, 1U);
CHECK_EQ(test.fUeq, 1U);
CHECK_EQ(test.fOlt, 0U);
CHECK_EQ(test.fUlt, 0U);
CHECK_EQ(test.fOle, 1U);
CHECK_EQ(test.fUle, 1U);
test.dOp1 = std::numeric_limits<double>::quiet_NaN();
test.dOp2 = 0.0;
test.fOp1 = std::numeric_limits<float>::quiet_NaN();
test.fOp2 = 0.0;
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
CHECK_EQ(test.dF, 0);
CHECK_EQ(test.dUn, 1);
CHECK_EQ(test.dEq, 0);
CHECK_EQ(test.dUeq, 1);
CHECK_EQ(test.dOlt, 0);
CHECK_EQ(test.dUlt, 1);
CHECK_EQ(test.dOle, 0);
CHECK_EQ(test.dUle, 1);
CHECK_EQ(test.fF, 0);
CHECK_EQ(test.fUn, 1);
CHECK_EQ(test.fEq, 0);
CHECK_EQ(test.fUeq, 1);
CHECK_EQ(test.fOlt, 0);
CHECK_EQ(test.fUlt, 1);
CHECK_EQ(test.fOle, 0);
CHECK_EQ(test.fUle, 1);
CHECK_EQ(test.dF, 0U);
CHECK_EQ(test.dUn, 1U);
CHECK_EQ(test.dEq, 0U);
CHECK_EQ(test.dUeq, 1U);
CHECK_EQ(test.dOlt, 0U);
CHECK_EQ(test.dUlt, 1U);
CHECK_EQ(test.dOle, 0U);
CHECK_EQ(test.dUle, 1U);
CHECK_EQ(test.fF, 0U);
CHECK_EQ(test.fUn, 1U);
CHECK_EQ(test.fEq, 0U);
CHECK_EQ(test.fUeq, 1U);
CHECK_EQ(test.fOlt, 0U);
CHECK_EQ(test.fUlt, 1U);
CHECK_EQ(test.fOle, 0U);
CHECK_EQ(test.fUle, 1U);
}
}
......
......@@ -5786,7 +5786,7 @@ TEST(NewSpaceAllocationCounter) {
CHECK_EQ(kSize, counter2 - counter1);
heap->CollectGarbage(NEW_SPACE);
size_t counter3 = heap->NewSpaceAllocationCounter();
CHECK_EQ(0, counter3 - counter2);
CHECK_EQ(0U, counter3 - counter2);
// Test counter overflow.
size_t max_counter = -1;
heap->set_new_space_allocation_counter(max_counter - 10 * kSize);
......
......@@ -190,8 +190,9 @@ TEST_F(CommonOperatorTest, End) {
EXPECT_EQ(Operator::kKontrol, op->properties());
EXPECT_EQ(0, op->ValueInputCount());
EXPECT_EQ(0, op->EffectInputCount());
EXPECT_EQ(input_count, op->ControlInputCount());
EXPECT_EQ(input_count, OperatorProperties::GetTotalInputCount(op));
EXPECT_EQ(input_count, static_cast<uint32_t>(op->ControlInputCount()));
EXPECT_EQ(input_count, static_cast<uint32_t>(
OperatorProperties::GetTotalInputCount(op)));
EXPECT_EQ(0, op->ValueOutputCount());
EXPECT_EQ(0, op->EffectOutputCount());
EXPECT_EQ(0, op->ControlOutputCount());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment