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

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

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