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

Unified Diff: test/cctest/compiler/test-run-machops.cc

Issue 877753007: Reland "Initial switch to Chromium-style CHECK_* and DCHECK_* macros.". (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: VS201x now happy? Created 5 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 | « test/cctest/compiler/test-representation-change.cc ('k') | test/cctest/compiler/value-helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-run-machops.cc
diff --git a/test/cctest/compiler/test-run-machops.cc b/test/cctest/compiler/test-run-machops.cc
index a5a6823303a7c2d8783ab8b5449118d41b0c3a7e..2d205758aa9026d8e98885d5241ec4ac8e25cf07 100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -15,10 +15,6 @@
#if V8_TURBOFAN_TARGET
using namespace v8::base;
-
-#define CHECK_UINT32_EQ(x, y) \
- CHECK_EQ(static_cast<int32_t>(x), static_cast<int32_t>(y))
-
using namespace v8::internal;
using namespace v8::internal::compiler;
@@ -505,7 +501,7 @@ TEST(RunLoadStoreFloat64Offset) {
p1 = *j;
p2 = *j - 5;
CHECK_EQ(magic, m.Call());
- CHECK_EQ(p1, p2);
+ CheckDoubleEq(p1, p2);
}
}
}
@@ -763,7 +759,7 @@ TEST(RunInt32AddInBranch) {
static const int32_t constant = 987654321;
{
RawMachineAssemblerTester<int32_t> m;
- Uint32BinopTester bt(&m);
+ Int32BinopTester bt(&m);
MLabel blocka, blockb;
m.Branch(
m.Word32Equal(m.Int32Add(bt.param0, bt.param1), m.Int32Constant(0)),
@@ -781,7 +777,7 @@ TEST(RunInt32AddInBranch) {
}
{
RawMachineAssemblerTester<int32_t> m;
- Uint32BinopTester bt(&m);
+ Int32BinopTester bt(&m);
MLabel blocka, blockb;
m.Branch(
m.Word32NotEqual(m.Int32Add(bt.param0, bt.param1), m.Int32Constant(0)),
@@ -810,7 +806,7 @@ TEST(RunInt32AddInBranch) {
m.Return(m.Int32Constant(0 - constant));
FOR_UINT32_INPUTS(j) {
uint32_t expected = (*i + *j) == 0 ? constant : 0 - constant;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -827,7 +823,7 @@ TEST(RunInt32AddInBranch) {
m.Return(m.Int32Constant(0 - constant));
FOR_UINT32_INPUTS(j) {
uint32_t expected = (*i + *j) != 0 ? constant : 0 - constant;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -885,7 +881,7 @@ TEST(RunInt32AddInComparison) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
uint32_t expected = (*i + *j) == 0;
- CHECK_UINT32_EQ(expected, bt.call(*i, *j));
+ CHECK_EQ(expected, bt.call(*i, *j));
}
}
}
@@ -897,7 +893,7 @@ TEST(RunInt32AddInComparison) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
uint32_t expected = (*i + *j) == 0;
- CHECK_UINT32_EQ(expected, bt.call(*i, *j));
+ CHECK_EQ(expected, bt.call(*i, *j));
}
}
}
@@ -908,7 +904,7 @@ TEST(RunInt32AddInComparison) {
m.Int32Constant(0)));
FOR_UINT32_INPUTS(j) {
uint32_t expected = (*i + *j) == 0;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -919,7 +915,7 @@ TEST(RunInt32AddInComparison) {
m.Int32Constant(0)));
FOR_UINT32_INPUTS(j) {
uint32_t expected = (*j + *i) == 0;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -971,7 +967,7 @@ TEST(RunInt32SubP) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
uint32_t expected = static_cast<int32_t>(*i - *j);
- CHECK_UINT32_EQ(expected, bt.call(*i, *j));
+ CHECK_EQ(expected, bt.call(*i, *j));
}
}
}
@@ -984,7 +980,7 @@ TEST(RunInt32SubImm) {
m.Return(m.Int32Sub(m.Int32Constant(*i), m.Parameter(0)));
FOR_UINT32_INPUTS(j) {
uint32_t expected = *i - *j;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -994,7 +990,7 @@ TEST(RunInt32SubImm) {
m.Return(m.Int32Sub(m.Parameter(0), m.Int32Constant(*i)));
FOR_UINT32_INPUTS(j) {
uint32_t expected = *j - *i;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -1072,8 +1068,8 @@ TEST(RunInt32SubAndWord32ShrP) {
FOR_UINT32_INPUTS(j) {
FOR_UINT32_SHIFTS(shift) {
// Use uint32_t because signed overflow is UB in C.
- int32_t expected = *i - (*j >> shift);
- CHECK_UINT32_EQ(expected, m.Call(*i, *j, shift));
+ uint32_t expected = *i - (*j >> shift);
+ CHECK_EQ(expected, m.Call(*i, *j, shift));
}
}
}
@@ -1087,7 +1083,7 @@ TEST(RunInt32SubAndWord32ShrP) {
FOR_UINT32_SHIFTS(shift) {
FOR_UINT32_INPUTS(k) {
// Use uint32_t because signed overflow is UB in C.
- int32_t expected = (*i >> shift) - *k;
+ uint32_t expected = (*i >> shift) - *k;
CHECK_EQ(expected, m.Call(*i, shift, *k));
}
}
@@ -1100,7 +1096,7 @@ TEST(RunInt32SubInBranch) {
static const int constant = 987654321;
{
RawMachineAssemblerTester<int32_t> m;
- Uint32BinopTester bt(&m);
+ Int32BinopTester bt(&m);
MLabel blocka, blockb;
m.Branch(
m.Word32Equal(m.Int32Sub(bt.param0, bt.param1), m.Int32Constant(0)),
@@ -1118,7 +1114,7 @@ TEST(RunInt32SubInBranch) {
}
{
RawMachineAssemblerTester<int32_t> m;
- Uint32BinopTester bt(&m);
+ Int32BinopTester bt(&m);
MLabel blocka, blockb;
m.Branch(
m.Word32NotEqual(m.Int32Sub(bt.param0, bt.param1), m.Int32Constant(0)),
@@ -1146,7 +1142,7 @@ TEST(RunInt32SubInBranch) {
m.Bind(&blockb);
m.Return(m.Int32Constant(0 - constant));
FOR_UINT32_INPUTS(j) {
- int32_t expected = (*i - *j) == 0 ? constant : 0 - constant;
+ uint32_t expected = (*i - *j) == 0 ? constant : 0 - constant;
CHECK_EQ(expected, m.Call(*j));
}
}
@@ -1222,7 +1218,7 @@ TEST(RunInt32SubInComparison) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
uint32_t expected = (*i - *j) == 0;
- CHECK_UINT32_EQ(expected, bt.call(*i, *j));
+ CHECK_EQ(expected, bt.call(*i, *j));
}
}
}
@@ -1234,7 +1230,7 @@ TEST(RunInt32SubInComparison) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
uint32_t expected = (*i - *j) == 0;
- CHECK_UINT32_EQ(expected, bt.call(*i, *j));
+ CHECK_EQ(expected, bt.call(*i, *j));
}
}
}
@@ -1245,7 +1241,7 @@ TEST(RunInt32SubInComparison) {
m.Int32Constant(0)));
FOR_UINT32_INPUTS(j) {
uint32_t expected = (*i - *j) == 0;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -1256,7 +1252,7 @@ TEST(RunInt32SubInComparison) {
m.Int32Constant(0)));
FOR_UINT32_INPUTS(j) {
uint32_t expected = (*j - *i) == 0;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -1318,7 +1314,7 @@ TEST(RunInt32MulP) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
uint32_t expected = *i * *j;
- CHECK_UINT32_EQ(expected, bt.call(*i, *j));
+ CHECK_EQ(expected, bt.call(*i, *j));
}
}
}
@@ -1346,7 +1342,7 @@ TEST(RunInt32MulImm) {
m.Return(m.Int32Mul(m.Int32Constant(*i), m.Parameter(0)));
FOR_UINT32_INPUTS(j) {
uint32_t expected = *i * *j;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -1356,7 +1352,7 @@ TEST(RunInt32MulImm) {
m.Return(m.Int32Mul(m.Parameter(0), m.Int32Constant(*i)));
FOR_UINT32_INPUTS(j) {
uint32_t expected = *j * *i;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -1527,7 +1523,7 @@ TEST(RunUint32DivP) {
uint32_t p0 = *i;
uint32_t p1 = *j;
if (p1 != 0) {
- uint32_t expected = static_cast<uint32_t>(p0 / p1);
+ int32_t expected = bit_cast<int32_t>(p0 / p1);
CHECK_EQ(expected, bt.call(p0, p1));
}
}
@@ -1542,7 +1538,7 @@ TEST(RunUint32DivP) {
uint32_t p0 = *i;
uint32_t p1 = *j;
if (p1 != 0) {
- uint32_t expected = static_cast<uint32_t>(p0 + (p0 / p1));
+ int32_t expected = bit_cast<int32_t>(p0 + (p0 / p1));
CHECK_EQ(expected, bt.call(p0, p1));
}
}
@@ -1588,7 +1584,7 @@ TEST(RunInt32ModP) {
TEST(RunUint32ModP) {
{
RawMachineAssemblerTester<int32_t> m;
- Int32BinopTester bt(&m);
+ Uint32BinopTester bt(&m);
bt.AddReturn(m.Uint32Mod(bt.param0, bt.param1));
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
@@ -1603,7 +1599,7 @@ TEST(RunUint32ModP) {
}
{
RawMachineAssemblerTester<int32_t> m;
- Int32BinopTester bt(&m);
+ Uint32BinopTester bt(&m);
bt.AddReturn(m.Int32Add(bt.param0, m.Uint32Mod(bt.param0, bt.param1)));
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
@@ -1626,7 +1622,7 @@ TEST(RunWord32AndP) {
bt.AddReturn(m.Word32And(bt.param0, bt.param1));
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
- uint32_t expected = *i & *j;
+ int32_t expected = *i & *j;
CHECK_EQ(expected, bt.call(*i, *j));
}
}
@@ -1637,7 +1633,7 @@ TEST(RunWord32AndP) {
bt.AddReturn(m.Word32And(bt.param0, m.Word32Not(bt.param1)));
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
- uint32_t expected = *i & ~(*j);
+ int32_t expected = *i & ~(*j);
CHECK_EQ(expected, bt.call(*i, *j));
}
}
@@ -1648,7 +1644,7 @@ TEST(RunWord32AndP) {
bt.AddReturn(m.Word32And(m.Word32Not(bt.param0), bt.param1));
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
- uint32_t expected = ~(*i) & *j;
+ int32_t expected = ~(*i) & *j;
CHECK_EQ(expected, bt.call(*i, *j));
}
}
@@ -1665,7 +1661,7 @@ TEST(RunWord32AndAndWord32ShlP) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
uint32_t expected = *i << (*j & 0x1f);
- CHECK_UINT32_EQ(expected, bt.call(*i, *j));
+ CHECK_EQ(expected, bt.call(*i, *j));
}
}
}
@@ -1677,7 +1673,7 @@ TEST(RunWord32AndAndWord32ShlP) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
uint32_t expected = *i << (0x1f & *j);
- CHECK_UINT32_EQ(expected, bt.call(*i, *j));
+ CHECK_EQ(expected, bt.call(*i, *j));
}
}
}
@@ -1693,7 +1689,7 @@ TEST(RunWord32AndAndWord32ShrP) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
uint32_t expected = *i >> (*j & 0x1f);
- CHECK_UINT32_EQ(expected, bt.call(*i, *j));
+ CHECK_EQ(expected, bt.call(*i, *j));
}
}
}
@@ -1705,7 +1701,7 @@ TEST(RunWord32AndAndWord32ShrP) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
uint32_t expected = *i >> (0x1f & *j);
- CHECK_UINT32_EQ(expected, bt.call(*i, *j));
+ CHECK_EQ(expected, bt.call(*i, *j));
}
}
}
@@ -1732,7 +1728,7 @@ TEST(RunWord32AndAndWord32SarP) {
m.Word32Sar(bt.param0, m.Word32And(m.Int32Constant(0x1f), bt.param1)));
FOR_INT32_INPUTS(i) {
FOR_INT32_INPUTS(j) {
- uint32_t expected = *i >> (0x1f & *j);
+ int32_t expected = *i >> (0x1f & *j);
CHECK_EQ(expected, bt.call(*i, *j));
}
}
@@ -1747,7 +1743,7 @@ TEST(RunWord32AndImm) {
m.Return(m.Word32And(m.Int32Constant(*i), m.Parameter(0)));
FOR_UINT32_INPUTS(j) {
uint32_t expected = *i & *j;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -1757,7 +1753,7 @@ TEST(RunWord32AndImm) {
m.Return(m.Word32And(m.Int32Constant(*i), m.Word32Not(m.Parameter(0))));
FOR_UINT32_INPUTS(j) {
uint32_t expected = *i & ~(*j);
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -1768,7 +1764,7 @@ TEST(RunWord32AndInBranch) {
static const int constant = 987654321;
{
RawMachineAssemblerTester<int32_t> m;
- Uint32BinopTester bt(&m);
+ Int32BinopTester bt(&m);
MLabel blocka, blockb;
m.Branch(
m.Word32Equal(m.Word32And(bt.param0, bt.param1), m.Int32Constant(0)),
@@ -1786,7 +1782,7 @@ TEST(RunWord32AndInBranch) {
}
{
RawMachineAssemblerTester<int32_t> m;
- Uint32BinopTester bt(&m);
+ Int32BinopTester bt(&m);
MLabel blocka, blockb;
m.Branch(
m.Word32NotEqual(m.Word32And(bt.param0, bt.param1), m.Int32Constant(0)),
@@ -1891,7 +1887,7 @@ TEST(RunWord32AndInComparison) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
uint32_t expected = (*i & *j) == 0;
- CHECK_UINT32_EQ(expected, bt.call(*i, *j));
+ CHECK_EQ(expected, bt.call(*i, *j));
}
}
}
@@ -1903,7 +1899,7 @@ TEST(RunWord32AndInComparison) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
uint32_t expected = (*i & *j) == 0;
- CHECK_UINT32_EQ(expected, bt.call(*i, *j));
+ CHECK_EQ(expected, bt.call(*i, *j));
}
}
}
@@ -1914,7 +1910,7 @@ TEST(RunWord32AndInComparison) {
m.Int32Constant(0)));
FOR_UINT32_INPUTS(j) {
uint32_t expected = (*i & *j) == 0;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -1925,7 +1921,7 @@ TEST(RunWord32AndInComparison) {
m.Int32Constant(0)));
FOR_UINT32_INPUTS(j) {
uint32_t expected = (*j & *i) == 0;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -1940,7 +1936,7 @@ TEST(RunWord32OrP) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
uint32_t expected = *i | *j;
- CHECK_UINT32_EQ(expected, bt.call(*i, *j));
+ CHECK_EQ(expected, bt.call(*i, *j));
}
}
}
@@ -1951,7 +1947,7 @@ TEST(RunWord32OrP) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
uint32_t expected = *i | ~(*j);
- CHECK_UINT32_EQ(expected, bt.call(*i, *j));
+ CHECK_EQ(expected, bt.call(*i, *j));
}
}
}
@@ -1962,7 +1958,7 @@ TEST(RunWord32OrP) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
uint32_t expected = ~(*i) | *j;
- CHECK_UINT32_EQ(expected, bt.call(*i, *j));
+ CHECK_EQ(expected, bt.call(*i, *j));
}
}
}
@@ -1976,7 +1972,7 @@ TEST(RunWord32OrImm) {
m.Return(m.Word32Or(m.Int32Constant(*i), m.Parameter(0)));
FOR_UINT32_INPUTS(j) {
uint32_t expected = *i | *j;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -1986,7 +1982,7 @@ TEST(RunWord32OrImm) {
m.Return(m.Word32Or(m.Int32Constant(*i), m.Word32Not(m.Parameter(0))));
FOR_UINT32_INPUTS(j) {
uint32_t expected = *i | ~(*j);
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -2113,7 +2109,7 @@ TEST(RunWord32OrInBranch) {
TEST(RunWord32OrInComparison) {
{
RawMachineAssemblerTester<int32_t> m;
- Uint32BinopTester bt(&m);
+ Int32BinopTester bt(&m);
bt.AddReturn(
m.Word32Equal(m.Word32Or(bt.param0, bt.param1), m.Int32Constant(0)));
FOR_UINT32_INPUTS(i) {
@@ -2125,7 +2121,7 @@ TEST(RunWord32OrInComparison) {
}
{
RawMachineAssemblerTester<int32_t> m;
- Uint32BinopTester bt(&m);
+ Int32BinopTester bt(&m);
bt.AddReturn(
m.Word32Equal(m.Int32Constant(0), m.Word32Or(bt.param0, bt.param1)));
FOR_UINT32_INPUTS(i) {
@@ -2142,7 +2138,7 @@ TEST(RunWord32OrInComparison) {
m.Int32Constant(0)));
FOR_UINT32_INPUTS(j) {
uint32_t expected = (*i | *j) == 0;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -2153,7 +2149,7 @@ TEST(RunWord32OrInComparison) {
m.Int32Constant(0)));
FOR_UINT32_INPUTS(j) {
uint32_t expected = (*j | *i) == 0;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -2163,11 +2159,11 @@ TEST(RunWord32OrInComparison) {
TEST(RunWord32XorP) {
{
FOR_UINT32_INPUTS(i) {
- RawMachineAssemblerTester<int32_t> m(kMachUint32);
+ RawMachineAssemblerTester<uint32_t> m(kMachUint32);
m.Return(m.Word32Xor(m.Int32Constant(*i), m.Parameter(0)));
FOR_UINT32_INPUTS(j) {
uint32_t expected = *i ^ *j;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -2177,8 +2173,8 @@ TEST(RunWord32XorP) {
bt.AddReturn(m.Word32Xor(bt.param0, bt.param1));
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
- int32_t expected = *i ^ *j;
- CHECK_UINT32_EQ(expected, bt.call(*i, *j));
+ uint32_t expected = *i ^ *j;
+ CHECK_EQ(expected, bt.call(*i, *j));
}
}
}
@@ -2210,7 +2206,7 @@ TEST(RunWord32XorP) {
m.Return(m.Word32Xor(m.Int32Constant(*i), m.Word32Not(m.Parameter(0))));
FOR_UINT32_INPUTS(j) {
uint32_t expected = *i ^ ~(*j);
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -2233,7 +2229,7 @@ TEST(RunWord32XorInBranch) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
uint32_t expected = (*i ^ *j) == 0 ? constant : 0 - constant;
- CHECK_UINT32_EQ(expected, bt.call(*i, *j));
+ CHECK_EQ(expected, bt.call(*i, *j));
}
}
}
@@ -2251,7 +2247,7 @@ TEST(RunWord32XorInBranch) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
uint32_t expected = (*i ^ *j) != 0 ? constant : 0 - constant;
- CHECK_UINT32_EQ(expected, bt.call(*i, *j));
+ CHECK_EQ(expected, bt.call(*i, *j));
}
}
}
@@ -2268,7 +2264,7 @@ TEST(RunWord32XorInBranch) {
m.Return(m.Int32Constant(0 - constant));
FOR_UINT32_INPUTS(j) {
uint32_t expected = (*i ^ *j) == 0 ? constant : 0 - constant;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -2286,7 +2282,7 @@ TEST(RunWord32XorInBranch) {
m.Return(m.Int32Constant(0 - constant));
FOR_UINT32_INPUTS(j) {
uint32_t expected = (*i ^ *j) != 0 ? constant : 0 - constant;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -2342,7 +2338,7 @@ TEST(RunWord32ShlP) {
m.Return(m.Word32Shl(m.Parameter(0), m.Int32Constant(shift)));
FOR_UINT32_INPUTS(j) {
uint32_t expected = *j << shift;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -2353,7 +2349,7 @@ TEST(RunWord32ShlP) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_SHIFTS(shift) {
uint32_t expected = *i << shift;
- CHECK_UINT32_EQ(expected, bt.call(*i, shift));
+ CHECK_EQ(expected, bt.call(*i, shift));
}
}
}
@@ -2369,7 +2365,7 @@ TEST(RunWord32ShlInComparison) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_SHIFTS(shift) {
uint32_t expected = 0 == (*i << shift);
- CHECK_UINT32_EQ(expected, bt.call(*i, shift));
+ CHECK_EQ(expected, bt.call(*i, shift));
}
}
}
@@ -2381,31 +2377,31 @@ TEST(RunWord32ShlInComparison) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_SHIFTS(shift) {
uint32_t expected = 0 == (*i << shift);
- CHECK_UINT32_EQ(expected, bt.call(*i, shift));
+ CHECK_EQ(expected, bt.call(*i, shift));
}
}
}
{
FOR_UINT32_SHIFTS(shift) {
- RawMachineAssemblerTester<int32_t> m(kMachUint32);
+ RawMachineAssemblerTester<uint32_t> m(kMachUint32);
m.Return(
m.Word32Equal(m.Int32Constant(0),
m.Word32Shl(m.Parameter(0), m.Int32Constant(shift))));
FOR_UINT32_INPUTS(i) {
uint32_t expected = 0 == (*i << shift);
- CHECK_UINT32_EQ(expected, m.Call(*i));
+ CHECK_EQ(expected, m.Call(*i));
}
}
}
{
FOR_UINT32_SHIFTS(shift) {
- RawMachineAssemblerTester<int32_t> m(kMachUint32);
+ RawMachineAssemblerTester<uint32_t> m(kMachUint32);
m.Return(
m.Word32Equal(m.Word32Shl(m.Parameter(0), m.Int32Constant(shift)),
m.Int32Constant(0)));
FOR_UINT32_INPUTS(i) {
uint32_t expected = 0 == (*i << shift);
- CHECK_UINT32_EQ(expected, m.Call(*i));
+ CHECK_EQ(expected, m.Call(*i));
}
}
}
@@ -2419,7 +2415,7 @@ TEST(RunWord32ShrP) {
m.Return(m.Word32Shr(m.Parameter(0), m.Int32Constant(shift)));
FOR_UINT32_INPUTS(j) {
uint32_t expected = *j >> shift;
- CHECK_UINT32_EQ(expected, m.Call(*j));
+ CHECK_EQ(expected, m.Call(*j));
}
}
}
@@ -2430,10 +2426,10 @@ TEST(RunWord32ShrP) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_SHIFTS(shift) {
uint32_t expected = *i >> shift;
- CHECK_UINT32_EQ(expected, bt.call(*i, shift));
+ CHECK_EQ(expected, bt.call(*i, shift));
}
}
- CHECK_EQ(0x00010000, bt.call(0x80000000, 15));
+ CHECK_EQ(0x00010000u, bt.call(0x80000000, 15));
}
}
@@ -2447,7 +2443,7 @@ TEST(RunWord32ShrInComparison) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_SHIFTS(shift) {
uint32_t expected = 0 == (*i >> shift);
- CHECK_UINT32_EQ(expected, bt.call(*i, shift));
+ CHECK_EQ(expected, bt.call(*i, shift));
}
}
}
@@ -2459,31 +2455,31 @@ TEST(RunWord32ShrInComparison) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_SHIFTS(shift) {
uint32_t expected = 0 == (*i >> shift);
- CHECK_UINT32_EQ(expected, bt.call(*i, shift));
+ CHECK_EQ(expected, bt.call(*i, shift));
}
}
}
{
FOR_UINT32_SHIFTS(shift) {
- RawMachineAssemblerTester<int32_t> m(kMachUint32);
+ RawMachineAssemblerTester<uint32_t> m(kMachUint32);
m.Return(
m.Word32Equal(m.Int32Constant(0),
m.Word32Shr(m.Parameter(0), m.Int32Constant(shift))));
FOR_UINT32_INPUTS(i) {
uint32_t expected = 0 == (*i >> shift);
- CHECK_UINT32_EQ(expected, m.Call(*i));
+ CHECK_EQ(expected, m.Call(*i));
}
}
}
{
FOR_UINT32_SHIFTS(shift) {
- RawMachineAssemblerTester<int32_t> m(kMachUint32);
+ RawMachineAssemblerTester<uint32_t> m(kMachUint32);
m.Return(
m.Word32Equal(m.Word32Shr(m.Parameter(0), m.Int32Constant(shift)),
m.Int32Constant(0)));
FOR_UINT32_INPUTS(i) {
uint32_t expected = 0 == (*i >> shift);
- CHECK_UINT32_EQ(expected, m.Call(*i));
+ CHECK_EQ(expected, m.Call(*i));
}
}
}
@@ -2511,7 +2507,7 @@ TEST(RunWord32SarP) {
CHECK_EQ(expected, bt.call(*i, shift));
}
}
- CHECK_EQ(0xFFFF0000, bt.call(0x80000000, 15));
+ CHECK_EQ(bit_cast<int32_t>(0xFFFF0000), bt.call(0x80000000, 15));
}
}
@@ -2560,7 +2556,7 @@ TEST(RunWord32SarInComparison) {
m.Word32Equal(m.Word32Sar(m.Parameter(0), m.Int32Constant(shift)),
m.Int32Constant(0)));
FOR_INT32_INPUTS(i) {
- uint32_t expected = 0 == (*i >> shift);
+ int32_t expected = 0 == (*i >> shift);
CHECK_EQ(expected, m.Call(*i));
}
}
@@ -2586,7 +2582,7 @@ TEST(RunWord32RorP) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_SHIFTS(shift) {
uint32_t expected = bits::RotateRight32(*i, shift);
- CHECK_UINT32_EQ(expected, bt.call(*i, shift));
+ CHECK_EQ(expected, bt.call(*i, shift));
}
}
}
@@ -2602,7 +2598,7 @@ TEST(RunWord32RorInComparison) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_SHIFTS(shift) {
uint32_t expected = 0 == bits::RotateRight32(*i, shift);
- CHECK_UINT32_EQ(expected, bt.call(*i, shift));
+ CHECK_EQ(expected, bt.call(*i, shift));
}
}
}
@@ -2614,31 +2610,31 @@ TEST(RunWord32RorInComparison) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_SHIFTS(shift) {
uint32_t expected = 0 == bits::RotateRight32(*i, shift);
- CHECK_UINT32_EQ(expected, bt.call(*i, shift));
+ CHECK_EQ(expected, bt.call(*i, shift));
}
}
}
{
FOR_UINT32_SHIFTS(shift) {
- RawMachineAssemblerTester<int32_t> m(kMachUint32);
+ RawMachineAssemblerTester<uint32_t> m(kMachUint32);
m.Return(
m.Word32Equal(m.Int32Constant(0),
m.Word32Ror(m.Parameter(0), m.Int32Constant(shift))));
FOR_UINT32_INPUTS(i) {
uint32_t expected = 0 == bits::RotateRight32(*i, shift);
- CHECK_UINT32_EQ(expected, m.Call(*i));
+ CHECK_EQ(expected, m.Call(*i));
}
}
}
{
FOR_UINT32_SHIFTS(shift) {
- RawMachineAssemblerTester<int32_t> m(kMachUint32);
+ RawMachineAssemblerTester<uint32_t> m(kMachUint32);
m.Return(
m.Word32Equal(m.Word32Ror(m.Parameter(0), m.Int32Constant(shift)),
m.Int32Constant(0)));
FOR_UINT32_INPUTS(i) {
uint32_t expected = 0 == bits::RotateRight32(*i, shift);
- CHECK_UINT32_EQ(expected, m.Call(*i));
+ CHECK_EQ(expected, m.Call(*i));
}
}
}
@@ -2964,7 +2960,7 @@ TEST(RunFloat64AddP) {
FOR_FLOAT64_INPUTS(pl) {
FOR_FLOAT64_INPUTS(pr) {
double expected = *pl + *pr;
- CHECK_EQ(expected, bt.call(*pl, *pr));
+ CheckDoubleEq(expected, bt.call(*pl, *pr));
}
}
}
@@ -2979,7 +2975,7 @@ TEST(RunFloat64SubP) {
FOR_FLOAT64_INPUTS(pl) {
FOR_FLOAT64_INPUTS(pr) {
double expected = *pl - *pr;
- CHECK_EQ(expected, bt.call(*pl, *pr));
+ CheckDoubleEq(expected, bt.call(*pl, *pr));
}
}
}
@@ -2999,7 +2995,7 @@ TEST(RunFloat64SubImm1) {
input = *j;
double expected = *i - input;
CHECK_EQ(0, m.Call());
- CHECK_EQ(expected, output);
+ CheckDoubleEq(expected, output);
}
}
}
@@ -3019,7 +3015,7 @@ TEST(RunFloat64SubImm2) {
input = *j;
double expected = input - *i;
CHECK_EQ(0, m.Call());
- CHECK_EQ(expected, output);
+ CheckDoubleEq(expected, output);
}
}
}
@@ -3034,7 +3030,7 @@ TEST(RunFloat64MulP) {
FOR_FLOAT64_INPUTS(pl) {
FOR_FLOAT64_INPUTS(pr) {
double expected = *pl * *pr;
- CHECK_EQ(expected, bt.call(*pl, *pr));
+ CheckDoubleEq(expected, bt.call(*pl, *pr));
}
}
}
@@ -3063,7 +3059,7 @@ TEST(RunFloat64MulAndFloat64AddP) {
volatile double temp = input_a * input_b;
volatile double expected = temp + input_c;
CHECK_EQ(0, m.Call());
- CHECK_EQ(expected, output);
+ CheckDoubleEq(expected, output);
}
}
}
@@ -3085,7 +3081,7 @@ TEST(RunFloat64MulAndFloat64AddP) {
volatile double temp = input_b * input_c;
volatile double expected = input_a + temp;
CHECK_EQ(0, m.Call());
- CHECK_EQ(expected, output);
+ CheckDoubleEq(expected, output);
}
}
}
@@ -3115,7 +3111,7 @@ TEST(RunFloat64MulAndFloat64SubP) {
volatile double temp = input_b * input_c;
volatile double expected = input_a - temp;
CHECK_EQ(0, m.Call());
- CHECK_EQ(expected, output);
+ CheckDoubleEq(expected, output);
}
}
}
@@ -3137,7 +3133,7 @@ TEST(RunFloat64MulImm) {
input = *j;
double expected = *i * input;
CHECK_EQ(0, m.Call());
- CHECK_EQ(expected, output);
+ CheckDoubleEq(expected, output);
}
}
}
@@ -3152,7 +3148,7 @@ TEST(RunFloat64MulImm) {
input = *j;
double expected = input * *i;
CHECK_EQ(0, m.Call());
- CHECK_EQ(expected, output);
+ CheckDoubleEq(expected, output);
}
}
}
@@ -3168,7 +3164,7 @@ TEST(RunFloat64DivP) {
FOR_FLOAT64_INPUTS(pl) {
FOR_FLOAT64_INPUTS(pr) {
double expected = *pl / *pr;
- CHECK_EQ(expected, bt.call(*pl, *pr));
+ CheckDoubleEq(expected, bt.call(*pl, *pr));
}
}
}
@@ -3184,7 +3180,7 @@ TEST(RunFloat64ModP) {
FOR_FLOAT64_INPUTS(j) {
double expected = modulo(*i, *j);
double found = bt.call(*i, *j);
- CHECK_EQ(expected, found);
+ CheckDoubleEq(expected, found);
}
}
}
@@ -3223,7 +3219,7 @@ TEST(RunChangeInt32ToFloat64_B) {
TEST(RunChangeUint32ToFloat64_B) {
- RawMachineAssemblerTester<int32_t> m(kMachUint32);
+ RawMachineAssemblerTester<uint32_t> m(kMachUint32);
double output = 0;
Node* convert = m.ChangeUint32ToFloat64(m.Parameter(0));
@@ -3404,7 +3400,7 @@ TEST(RunChangeFloat64ToInt32_spilled) {
TEST(RunChangeFloat64ToUint32_spilled) {
RawMachineAssemblerTester<uint32_t> m;
const int kNumInputs = 32;
- int32_t magic = 0x786234;
+ uint32_t magic = 0x786234;
double input[kNumInputs];
uint32_t result[kNumInputs];
Node* input_node[kNumInputs];
@@ -3433,9 +3429,9 @@ TEST(RunChangeFloat64ToUint32_spilled) {
for (int i = 0; i < kNumInputs; i++) {
if (i % 2) {
- CHECK_UINT32_EQ(result[i], static_cast<uint32_t>(100 + i + 2147483648u));
+ CHECK_EQ(result[i], static_cast<uint32_t>(100 + i + 2147483648u));
} else {
- CHECK_UINT32_EQ(result[i], static_cast<uint32_t>(100 + i));
+ CHECK_EQ(result[i], static_cast<uint32_t>(100 + i));
}
}
}
@@ -3444,7 +3440,7 @@ TEST(RunChangeFloat64ToUint32_spilled) {
TEST(RunTruncateFloat64ToFloat32_spilled) {
RawMachineAssemblerTester<uint32_t> m;
const int kNumInputs = 32;
- int32_t magic = 0x786234;
+ uint32_t magic = 0x786234;
double input[kNumInputs];
float result[kNumInputs];
Node* input_node[kNumInputs];
@@ -4368,7 +4364,7 @@ TEST(RunTruncateInt64ToInt32P) {
FOR_UINT32_INPUTS(i) {
FOR_UINT32_INPUTS(j) {
expected = (static_cast<uint64_t>(*j) << 32) | *i;
- CHECK_UINT32_EQ(expected, m.Call());
+ CHECK_EQ(static_cast<int32_t>(expected), m.Call());
}
}
}
@@ -4504,7 +4500,7 @@ TEST(RunTruncateFloat64ToFloat32) {
input = *i;
volatile double expected = DoubleToFloat32(input);
CHECK_EQ(0, m.Call());
- CHECK_EQ(expected, actual);
+ CheckDoubleEq(expected, actual);
}
}
« no previous file with comments | « test/cctest/compiler/test-representation-change.cc ('k') | test/cctest/compiler/value-helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698