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 52672c8a89204cdf1fcc7d275311813bbeaf9a46..1c43585778a9ac5e5a4b51d385f8d3c25d0be64d 100644 |
--- a/test/cctest/compiler/test-run-machops.cc |
+++ b/test/cctest/compiler/test-run-machops.cc |
@@ -4136,6 +4136,21 @@ TEST(RunTruncateFloat32ToInt32) { |
} |
+TEST(RunTruncateFloat32ToUint32) { |
+ BufferedRawMachineAssemblerTester<uint32_t> m(MachineType::Float32()); |
+ m.Return(m.TruncateFloat32ToUint32(m.Parameter(0))); |
+ |
+ FOR_UINT32_INPUTS(i) { |
ahaas
2016/01/29 10:45:08
Could you also run tests for FOR_FLOAT32_INPUTS wh
|
+ float input = static_cast<float>(*i); |
+ // This condition on 'input' is required because |
+ // static_cast<float>(UINT32_MAX) results in a value outside uint32 range. |
+ if (input < static_cast<float>(UINT32_MAX)) { |
+ CHECK_EQ(static_cast<uint32_t>(input), m.Call(input)); |
+ } |
+ } |
+} |
+ |
+ |
TEST(RunChangeFloat64ToInt32_A) { |
BufferedRawMachineAssemblerTester<int32_t> m; |
double magic = 11.1; |