mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
Add test for PR4873, which works for me.
llvm-svn: 80965
This commit is contained in:
parent
c24fb1af4f
commit
29f5444a38
@ -15,6 +15,12 @@
|
|||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
|
static double convertToDoubleFromString(const char *Str) {
|
||||||
|
llvm::APFloat F(0.0);
|
||||||
|
F.convertFromString(Str, llvm::APFloat::rmNearestTiesToEven);
|
||||||
|
return F.convertToDouble();
|
||||||
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
TEST(APFloatTest, Zero) {
|
TEST(APFloatTest, Zero) {
|
||||||
@ -303,6 +309,8 @@ TEST(APFloatTest, fromHexadecimalString) {
|
|||||||
|
|
||||||
EXPECT_EQ(1.0625, APFloat(APFloat::IEEEdouble, "0x1.1p0").convertToDouble());
|
EXPECT_EQ(1.0625, APFloat(APFloat::IEEEdouble, "0x1.1p0").convertToDouble());
|
||||||
EXPECT_EQ(1.0, APFloat(APFloat::IEEEdouble, "0x1p0").convertToDouble());
|
EXPECT_EQ(1.0, APFloat(APFloat::IEEEdouble, "0x1p0").convertToDouble());
|
||||||
|
|
||||||
|
EXPECT_EQ(2.71828, convertToDoubleFromString("2.71828"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GTEST_HAS_DEATH_TEST
|
#ifdef GTEST_HAS_DEATH_TEST
|
||||||
|
Loading…
Reference in New Issue
Block a user