Commit 4b3e4448 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[test] Remove redundant variables in value helpers

Clean up some redundant variables after https://crrev.com/c/1449615.

R=mstarzinger@chromium.org

Bug: v8:8562
Change-Id: I44d46b037978f8feff7486cdc5c521c74c0a1c9e
Reviewed-on: https://chromium-review.googlesource.com/c/1449617
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59298}
parent 96315d16
......@@ -22,20 +22,16 @@ TEST(CompareWrapper) {
CompareWrapper wUint32LessThan(IrOpcode::kUint32LessThan);
CompareWrapper wUint32LessThanOrEqual(IrOpcode::kUint32LessThanOrEqual);
FOR_INT32_INPUTS(pl) {
FOR_INT32_INPUTS(pr) {
int32_t a = pl;
int32_t b = pr;
FOR_INT32_INPUTS(a) {
FOR_INT32_INPUTS(b) {
CHECK_EQ(a == b, wWord32Equal.Int32Compare(a, b));
CHECK_EQ(a < b, wInt32LessThan.Int32Compare(a, b));
CHECK_EQ(a <= b, wInt32LessThanOrEqual.Int32Compare(a, b));
}
}
FOR_UINT32_INPUTS(pl) {
FOR_UINT32_INPUTS(pr) {
uint32_t a = pl;
uint32_t b = pr;
FOR_UINT32_INPUTS(a) {
FOR_UINT32_INPUTS(b) {
CHECK_EQ(a == b, wWord32Equal.Int32Compare(a, b));
CHECK_EQ(a < b, wUint32LessThan.Int32Compare(a, b));
CHECK_EQ(a <= b, wUint32LessThanOrEqual.Int32Compare(a, b));
......
This diff is collapsed.
......@@ -178,8 +178,7 @@ TEST(CanonicalizingNumbers) {
TEST(HeapNumbers) {
JSConstantCacheTester T;
FOR_FLOAT64_INPUTS(i) {
double value = i;
FOR_FLOAT64_INPUTS(value) {
Handle<Object> num = T.factory()->NewNumber(value);
Handle<HeapNumber> heap = T.factory()->NewHeapNumber(value);
Node* node1 = T.Constant(value);
......
......@@ -256,11 +256,8 @@ TEST(ReduceWord32And) {
ReducerTester R;
R.binop = R.machine.Word32And();
FOR_INT32_INPUTS(pl) {
FOR_INT32_INPUTS(pr) {
int32_t x = pl, y = pr;
R.CheckFoldBinop<int32_t>(x & y, x, y);
}
FOR_INT32_INPUTS(x) {
FOR_INT32_INPUTS(y) { R.CheckFoldBinop<int32_t>(x & y, x, y); }
}
R.CheckPutConstantOnRight(33);
......@@ -282,11 +279,8 @@ TEST(ReduceWord32Or) {
ReducerTester R;
R.binop = R.machine.Word32Or();
FOR_INT32_INPUTS(pl) {
FOR_INT32_INPUTS(pr) {
int32_t x = pl, y = pr;
R.CheckFoldBinop<int32_t>(x | y, x, y);
}
FOR_INT32_INPUTS(x) {
FOR_INT32_INPUTS(y) { R.CheckFoldBinop<int32_t>(x | y, x, y); }
}
R.CheckPutConstantOnRight(36);
......@@ -308,11 +302,8 @@ TEST(ReduceWord32Xor) {
ReducerTester R;
R.binop = R.machine.Word32Xor();
FOR_INT32_INPUTS(pl) {
FOR_INT32_INPUTS(pr) {
int32_t x = pl, y = pr;
R.CheckFoldBinop<int32_t>(x ^ y, x, y);
}
FOR_INT32_INPUTS(x) {
FOR_INT32_INPUTS(y) { R.CheckFoldBinop<int32_t>(x ^ y, x, y); }
}
R.CheckPutConstantOnRight(39);
......@@ -332,9 +323,8 @@ TEST(ReduceWord32Shl) {
R.binop = R.machine.Word32Shl();
// TODO(titzer): out of range shifts
FOR_INT32_INPUTS(i) {
FOR_INT32_INPUTS(x) {
for (int y = 0; y < 32; y++) {
int32_t x = i;
R.CheckFoldBinop<int32_t>(base::ShlWithWraparound(x, y), x, y);
}
}
......@@ -351,9 +341,8 @@ TEST(ReduceWord64Shl) {
ReducerTester R;
R.binop = R.machine.Word64Shl();
FOR_INT64_INPUTS(i) {
FOR_INT64_INPUTS(x) {
for (int64_t y = 0; y < 64; y++) {
int64_t x = i;
R.CheckFoldBinop<int64_t>(base::ShlWithWraparound(x, y), x, y);
}
}
......@@ -371,9 +360,8 @@ TEST(ReduceWord32Shr) {
R.binop = R.machine.Word32Shr();
// TODO(titzer): test out of range shifts
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(x) {
for (uint32_t y = 0; y < 32; y++) {
uint32_t x = i;
R.CheckFoldBinop<int32_t>(x >> y, x, y);
}
}
......@@ -390,9 +378,8 @@ TEST(ReduceWord64Shr) {
ReducerTester R;
R.binop = R.machine.Word64Shr();
FOR_UINT64_INPUTS(i) {
FOR_UINT64_INPUTS(x) {
for (uint64_t y = 0; y < 64; y++) {
uint64_t x = i;
R.CheckFoldBinop<int64_t>(x >> y, x, y);
}
}
......@@ -410,9 +397,8 @@ TEST(ReduceWord32Sar) {
R.binop = R.machine.Word32Sar();
// TODO(titzer): test out of range shifts
FOR_INT32_INPUTS(i) {
FOR_INT32_INPUTS(x) {
for (int32_t y = 0; y < 32; y++) {
int32_t x = i;
R.CheckFoldBinop<int32_t>(x >> y, x, y);
}
}
......@@ -429,9 +415,8 @@ TEST(ReduceWord64Sar) {
ReducerTester R;
R.binop = R.machine.Word64Sar();
FOR_INT64_INPUTS(i) {
FOR_INT64_INPUTS(x) {
for (int64_t y = 0; y < 64; y++) {
int64_t x = i;
R.CheckFoldBinop<int64_t>(x >> y, x, y);
}
}
......@@ -477,11 +462,8 @@ TEST(Word32Equal) {
ReducerTester R;
R.binop = R.machine.Word32Equal();
FOR_INT32_INPUTS(pl) {
FOR_INT32_INPUTS(pr) {
int32_t x = pl, y = pr;
R.CheckFoldBinop<int32_t>(x == y ? 1 : 0, x, y);
}
FOR_INT32_INPUTS(x) {
FOR_INT32_INPUTS(y) { R.CheckFoldBinop<int32_t>(x == y ? 1 : 0, x, y); }
}
R.CheckPutConstantOnRight(48);
......@@ -502,9 +484,8 @@ TEST(ReduceInt32Add) {
ReducerTester R;
R.binop = R.machine.Int32Add();
FOR_INT32_INPUTS(pl) {
FOR_INT32_INPUTS(pr) {
int32_t x = pl, y = pr;
FOR_INT32_INPUTS(x) {
FOR_INT32_INPUTS(y) {
R.CheckFoldBinop<int32_t>(base::AddWithWraparound(x, y), x, y);
}
}
......@@ -523,9 +504,8 @@ TEST(ReduceInt64Add) {
ReducerTester R;
R.binop = R.machine.Int64Add();
FOR_INT64_INPUTS(pl) {
FOR_INT64_INPUTS(pr) {
int64_t x = pl, y = pr;
FOR_INT64_INPUTS(x) {
FOR_INT64_INPUTS(y) {
R.CheckFoldBinop<int64_t>(base::AddWithWraparound(x, y), x, y);
}
}
......@@ -542,9 +522,8 @@ TEST(ReduceInt32Sub) {
ReducerTester R;
R.binop = R.machine.Int32Sub();
FOR_INT32_INPUTS(pl) {
FOR_INT32_INPUTS(pr) {
int32_t x = pl, y = pr;
FOR_INT32_INPUTS(x) {
FOR_INT32_INPUTS(y) {
R.CheckFoldBinop<int32_t>(base::SubWithWraparound(x, y), x, y);
}
}
......@@ -561,9 +540,8 @@ TEST(ReduceInt64Sub) {
ReducerTester R;
R.binop = R.machine.Int64Sub();
FOR_INT64_INPUTS(pl) {
FOR_INT64_INPUTS(pr) {
int64_t x = pl, y = pr;
FOR_INT64_INPUTS(x) {
FOR_INT64_INPUTS(y) {
R.CheckFoldBinop<int64_t>(base::SubWithWraparound(x, y), x, y);
}
}
......@@ -586,9 +564,8 @@ TEST(ReduceInt32Mul) {
ReducerTester R;
R.binop = R.machine.Int32Mul();
FOR_INT32_INPUTS(pl) {
FOR_INT32_INPUTS(pr) {
int32_t x = pl, y = pr;
FOR_INT32_INPUTS(x) {
FOR_INT32_INPUTS(y) {
R.CheckFoldBinop<int32_t>(base::MulWithWraparound(x, y), x, y);
}
}
......@@ -624,9 +601,8 @@ TEST(ReduceInt32Div) {
ReducerTester R;
R.binop = R.machine.Int32Div();
FOR_INT32_INPUTS(pl) {
FOR_INT32_INPUTS(pr) {
int32_t x = pl, y = pr;
FOR_INT32_INPUTS(x) {
FOR_INT32_INPUTS(y) {
if (y == 0) continue; // TODO(titzer): test / 0
int32_t r = y == -1 ? base::NegateWithWraparound(x)
: x / y; // INT_MIN / -1 may explode in C
......@@ -653,9 +629,8 @@ TEST(ReduceUint32Div) {
ReducerTester R;
R.binop = R.machine.Uint32Div();
FOR_UINT32_INPUTS(pl) {
FOR_UINT32_INPUTS(pr) {
uint32_t x = pl, y = pr;
FOR_UINT32_INPUTS(x) {
FOR_UINT32_INPUTS(y) {
if (y == 0) continue; // TODO(titzer): test / 0
R.CheckFoldBinop<int32_t>(x / y, x, y);
}
......@@ -682,9 +657,8 @@ TEST(ReduceInt32Mod) {
ReducerTester R;
R.binop = R.machine.Int32Mod();
FOR_INT32_INPUTS(pl) {
FOR_INT32_INPUTS(pr) {
int32_t x = pl, y = pr;
FOR_INT32_INPUTS(x) {
FOR_INT32_INPUTS(y) {
if (y == 0) continue; // TODO(titzer): test % 0
int32_t r = y == -1 ? 0 : x % y; // INT_MIN % -1 may explode in C
R.CheckFoldBinop<int32_t>(r, x, y);
......@@ -706,9 +680,8 @@ TEST(ReduceUint32Mod) {
ReducerTester R;
R.binop = R.machine.Uint32Mod();
FOR_INT32_INPUTS(pl) {
FOR_INT32_INPUTS(pr) {
uint32_t x = pl, y = pr;
FOR_UINT32_INPUTS(x) {
FOR_UINT32_INPUTS(y) {
if (y == 0) continue; // TODO(titzer): test x % 0
R.CheckFoldBinop<int32_t>(x % y, x, y);
}
......@@ -734,11 +707,8 @@ TEST(ReduceInt32LessThan) {
ReducerTester R;
R.binop = R.machine.Int32LessThan();
FOR_INT32_INPUTS(pl) {
FOR_INT32_INPUTS(pr) {
int32_t x = pl, y = pr;
R.CheckFoldBinop<int32_t>(x < y ? 1 : 0, x, y);
}
FOR_INT32_INPUTS(x) {
FOR_INT32_INPUTS(y) { R.CheckFoldBinop<int32_t>(x < y ? 1 : 0, x, y); }
}
R.CheckDontPutConstantOnRight(41399);
......@@ -754,11 +724,8 @@ TEST(ReduceInt32LessThanOrEqual) {
ReducerTester R;
R.binop = R.machine.Int32LessThanOrEqual();
FOR_INT32_INPUTS(pl) {
FOR_INT32_INPUTS(pr) {
int32_t x = pl, y = pr;
R.CheckFoldBinop<int32_t>(x <= y ? 1 : 0, x, y);
}
FOR_INT32_INPUTS(x) {
FOR_INT32_INPUTS(y) { R.CheckFoldBinop<int32_t>(x <= y ? 1 : 0, x, y); }
}
FOR_INT32_INPUTS(i) { R.CheckDontPutConstantOnRight<int32_t>(i); }
......@@ -773,11 +740,8 @@ TEST(ReduceUint32LessThan) {
ReducerTester R;
R.binop = R.machine.Uint32LessThan();
FOR_UINT32_INPUTS(pl) {
FOR_UINT32_INPUTS(pr) {
uint32_t x = pl, y = pr;
R.CheckFoldBinop<int32_t>(x < y ? 1 : 0, x, y);
}
FOR_UINT32_INPUTS(x) {
FOR_UINT32_INPUTS(y) { R.CheckFoldBinop<int32_t>(x < y ? 1 : 0, x, y); }
}
R.CheckDontPutConstantOnRight(41399);
......@@ -797,11 +761,8 @@ TEST(ReduceUint32LessThanOrEqual) {
ReducerTester R;
R.binop = R.machine.Uint32LessThanOrEqual();
FOR_UINT32_INPUTS(pl) {
FOR_UINT32_INPUTS(pr) {
uint32_t x = pl, y = pr;
R.CheckFoldBinop<int32_t>(x <= y ? 1 : 0, x, y);
}
FOR_UINT32_INPUTS(x) {
FOR_UINT32_INPUTS(y) { R.CheckFoldBinop<int32_t>(x <= y ? 1 : 0, x, y); }
}
R.CheckDontPutConstantOnRight(41399);
......@@ -846,11 +807,8 @@ TEST(ReduceFloat32Sub) {
ReducerTester R;
R.binop = R.machine.Float32Sub();
FOR_FLOAT32_INPUTS(pl) {
FOR_FLOAT32_INPUTS(pr) {
float x = pl, y = pr;
R.CheckFoldBinop<float>(x - y, x, y);
}
FOR_FLOAT32_INPUTS(x) {
FOR_FLOAT32_INPUTS(y) { R.CheckFoldBinop<float>(x - y, x, y); }
}
Node* x = R.Parameter();
......@@ -866,11 +824,8 @@ TEST(ReduceFloat64Sub) {
ReducerTester R;
R.binop = R.machine.Float64Sub();
FOR_FLOAT64_INPUTS(pl) {
FOR_FLOAT64_INPUTS(pr) {
double x = pl, y = pr;
R.CheckFoldBinop<double>(x - y, x, y);
}
FOR_FLOAT64_INPUTS(x) {
FOR_FLOAT64_INPUTS(y) { R.CheckFoldBinop<double>(x - y, x, y); }
}
Node* x = R.Parameter();
......
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