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 685918af7d974065ca82c1f59323e37a2ad686dc..aba0700306d0b3beb4949ce91872118b80671de6 100644 |
--- a/test/cctest/compiler/test-run-machops.cc |
+++ b/test/cctest/compiler/test-run-machops.cc |
@@ -4030,25 +4030,20 @@ TEST(RunTruncateFloat32ToInt32) { |
TEST(RunTruncateFloat32ToUint32) { |
BufferedRawMachineAssemblerTester<uint32_t> m(MachineType::Float32()); |
m.Return(m.TruncateFloat32ToUint32(m.Parameter(0))); |
- { |
FOR_UINT32_INPUTS(i) { |
volatile float input = static_cast<float>(*i); |
// This condition on 'input' is required because |
- // static_cast<float>(std::numeric_limits<uint32_t>::max()) results in a |
- // value outside uint32 range. |
- if (input < static_cast<float>(std::numeric_limits<uint32_t>::max())) { |
+ // static_cast<float>(UINT32_MAX) results in a value outside uint32 range. |
+ if (input < (static_cast<float>(static_cast<uint64_t>(UINT32_MAX) + 1))) { |
titzer
2016/06/30 10:55:26
Why don't we just spell out the constant as a floa
ahaas
2016/06/30 12:02:27
I wrote it this way because I think it is more rea
|
CHECK_EQ(static_cast<uint32_t>(input), m.Call(input)); |
} |
} |
- } |
- { |
- FOR_FLOAT32_INPUTS(i) { |
- if (*i <= static_cast<float>(std::numeric_limits<uint32_t>::max()) && |
- *i >= static_cast<float>(std::numeric_limits<uint32_t>::min())) { |
- CHECK_FLOAT_EQ(static_cast<uint32_t>(*i), m.Call(*i)); |
+ FOR_FLOAT32_INPUTS(j) { |
+ if (*j < (static_cast<float>(static_cast<uint64_t>(UINT32_MAX) + 1)) && |
+ *j > -1) { |
+ CHECK_FLOAT_EQ(static_cast<uint32_t>(*j), m.Call(*j)); |
} |
} |
- } |
} |