mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-24 12:20:00 +00:00
Revert rL316156 due to failure on APFloatTest.fromToStringSpecials
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316158 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
90ee44d185
commit
c6c4c8b8a6
@ -2543,12 +2543,12 @@ IEEEFloat::convertFromDecimalString(StringRef str, roundingMode rounding_mode) {
|
||||
}
|
||||
|
||||
bool IEEEFloat::convertFromStringSpecials(StringRef str) {
|
||||
if (str.equals("inf") || str.equals("INFINITY") || str.equals("+Inf")) {
|
||||
if (str.equals("inf") || str.equals("INFINITY")) {
|
||||
makeInf(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (str.equals("-inf") || str.equals("-INFINITY") || str.equals("-Inf")) {
|
||||
if (str.equals("-inf") || str.equals("-INFINITY")) {
|
||||
makeInf(true);
|
||||
return true;
|
||||
}
|
||||
|
@ -849,22 +849,6 @@ TEST(APFloatTest, fromDecimalString) {
|
||||
EXPECT_EQ(2.71828, convertToDoubleFromString("2.71828"));
|
||||
}
|
||||
|
||||
TEST(APFloatTest, fromToStringSpecials) {
|
||||
auto roundTrip = [] (const char* str) {
|
||||
return convertToString(convertToDoubleFromString(str), 0, 3).c_str();
|
||||
};
|
||||
EXPECT_STREQ("+Inf", roundTrip("+Inf"));
|
||||
EXPECT_STREQ("+Inf", roundTrip("INFINITY"));
|
||||
EXPECT_STREQ("+Inf", roundTrip("inf"));
|
||||
EXPECT_STREQ("-Inf", roundTrip("-Inf"));
|
||||
EXPECT_STREQ("-Inf", roundTrip("-INFINITY"));
|
||||
EXPECT_STREQ("-Inf", roundTrip("-inf"));
|
||||
EXPECT_STREQ("NaN", roundTrip("NaN"));
|
||||
EXPECT_STREQ("NaN", roundTrip("nan"));
|
||||
EXPECT_STREQ("NaN", roundTrip("-NaN"));
|
||||
EXPECT_STREQ("NaN", roundTrip("-nan"));
|
||||
}
|
||||
|
||||
TEST(APFloatTest, fromHexadecimalString) {
|
||||
EXPECT_EQ( 1.0, APFloat(APFloat::IEEEdouble(), "0x1p0").convertToDouble());
|
||||
EXPECT_EQ(+1.0, APFloat(APFloat::IEEEdouble(), "+0x1p0").convertToDouble());
|
||||
|
Loading…
Reference in New Issue
Block a user