[llvm] r306101 - Fix double->float truncation warning on MSVC
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 23 06:53:55 PDT 2017
Author: rksimon
Date: Fri Jun 23 08:53:55 2017
New Revision: 306101
URL: http://llvm.org/viewvc/llvm-project?rev=306101&view=rev
Log:
Fix double->float truncation warning on MSVC
Modified:
llvm/trunk/unittests/ADT/StringExtrasTest.cpp
Modified: llvm/trunk/unittests/ADT/StringExtrasTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/StringExtrasTest.cpp?rev=306101&r1=306100&r2=306101&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/StringExtrasTest.cpp (original)
+++ llvm/trunk/unittests/ADT/StringExtrasTest.cpp Fri Jun 23 08:53:55 2017
@@ -70,7 +70,7 @@ TEST(StringExtrasTest, ToAndFromHex) {
TEST(StringExtrasTest, to_float) {
float F;
EXPECT_TRUE(to_float("4.7", F));
- EXPECT_FLOAT_EQ(4.7, F);
+ EXPECT_FLOAT_EQ(4.7f, F);
double D;
EXPECT_TRUE(to_float("4.7", D));
@@ -82,5 +82,5 @@ TEST(StringExtrasTest, to_float) {
EXPECT_FALSE(to_float("foo", F));
EXPECT_FALSE(to_float("7.4 foo", F));
- EXPECT_FLOAT_EQ(4.7, F); // F should be unchanged
+ EXPECT_FLOAT_EQ(4.7f, F); // F should be unchanged
}
More information about the llvm-commits
mailing list