Add test for PR4873, which works for me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80965 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2009-09-03 22:57:02 +00:00
parent 3d45a853db
commit 83fecfa42c

View File

@ -15,6 +15,12 @@
using namespace llvm;
static double convertToDoubleFromString(const char *Str) {
llvm::APFloat F(0.0);
F.convertFromString(Str, llvm::APFloat::rmNearestTiesToEven);
return F.convertToDouble();
}
namespace {
TEST(APFloatTest, Zero) {
@ -303,6 +309,8 @@ TEST(APFloatTest, fromHexadecimalString) {
EXPECT_EQ(1.0625, APFloat(APFloat::IEEEdouble, "0x1.1p0").convertToDouble());
EXPECT_EQ(1.0, APFloat(APFloat::IEEEdouble, "0x1p0").convertToDouble());
EXPECT_EQ(2.71828, convertToDoubleFromString("2.71828"));
}
#ifdef GTEST_HAS_DEATH_TEST