llvm.org GIT mirror llvm / d263a71
Fix double->float truncation warning on MSVC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306101 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 2 years ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
6969 TEST(StringExtrasTest, to_float) {
7070 float F;
7171 EXPECT_TRUE(to_float("4.7", F));
72 EXPECT_FLOAT_EQ(4.7, F);
72 EXPECT_FLOAT_EQ(4.7f, F);
7373
7474 double D;
7575 EXPECT_TRUE(to_float("4.7", D));
8181
8282 EXPECT_FALSE(to_float("foo", F));
8383 EXPECT_FALSE(to_float("7.4 foo", F));
84 EXPECT_FLOAT_EQ(4.7, F); // F should be unchanged
84 EXPECT_FLOAT_EQ(4.7f, F); // F should be unchanged
8585 }