| 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 24007a83f6cbc4652f367315815354b054864b26..c37bef6e89fda869aafebd2a806ed6982165f615 100644
|
| --- a/test/cctest/compiler/test-run-machops.cc
|
| +++ b/test/cctest/compiler/test-run-machops.cc
|
| @@ -5430,7 +5430,7 @@ TEST(RunTryTruncateFloat64ToInt64WithCheck) {
|
|
|
| FOR_FLOAT64_INPUTS(i) {
|
| if (*i < 9223372036854775808.0 && *i > -9223372036854775809.0) {
|
| - // Conversions within this range
|
| + // Conversions within this range should succeed.
|
| CHECK_EQ(static_cast<int64_t>(*i), m.Call(*i));
|
| CHECK_NE(0, success);
|
| } else {
|
| @@ -5459,7 +5459,7 @@ TEST(RunTruncateFloat32ToUint64) {
|
| }
|
|
|
|
|
| -TEST(RunTruncateFloat64ToUint64) {
|
| +TEST(RunTryTruncateFloat64ToUint64) {
|
| BufferedRawMachineAssemblerTester<uint64_t> m(kMachFloat64);
|
| m.Return(m.TruncateFloat64ToUint64(m.Parameter(0)));
|
|
|
| @@ -5470,10 +5470,27 @@ TEST(RunTruncateFloat64ToUint64) {
|
| CHECK_EQ(static_cast<uint64_t>(input), m.Call(input));
|
| }
|
| }
|
| +}
|
| +
|
| +
|
| +TEST(RunTryTruncateFloat64ToUint64WithCheck) {
|
| + int64_t success = 0;
|
| + BufferedRawMachineAssemblerTester<int64_t> m(kMachFloat64);
|
| + Node* trunc = m.TryTruncateFloat64ToUint64(m.Parameter(0));
|
| + Node* val = m.Projection(0, trunc);
|
| + Node* check = m.Projection(1, trunc);
|
| + m.StoreToPointer(&success, kMachInt64, check);
|
| + m.Return(val);
|
|
|
| FOR_FLOAT64_INPUTS(i) {
|
| + printf("input: %f\n", *i);
|
| if (*i < 18446744073709551616.0 && *i >= 0) {
|
| + // Conversions within this range should succeed.
|
| CHECK_EQ(static_cast<uint64_t>(*i), m.Call(*i));
|
| + CHECK_NE(0, success);
|
| + } else {
|
| + m.Call(*i);
|
| + CHECK_EQ(0, success);
|
| }
|
| }
|
| }
|
|
|