mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
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:
parent
3d45a853db
commit
83fecfa42c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user