diff options
author | John McCall <rjmccall@apple.com> | 2010-02-03 03:42:44 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-02-03 03:42:44 +0000 |
commit | 68bf224f220c556d7dd0b02300f44f8d9fd2c919 (patch) | |
tree | 50e4c874d9cbddc81024ed8e9a4acf4154b12c0d /unittests | |
parent | 411c05288da7bed30b35be92bcf6cca5466364db (diff) | |
download | external_llvm-68bf224f220c556d7dd0b02300f44f8d9fd2c919.zip external_llvm-68bf224f220c556d7dd0b02300f44f8d9fd2c919.tar.gz external_llvm-68bf224f220c556d7dd0b02300f44f8d9fd2c919.tar.bz2 |
Make APInt::countLeadingZerosSlowCase() treat the contents of padding bits
as undefined. Fixes an assertion in APFloat::toString noticed by Dale.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95196 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/ADT/APFloatTest.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/unittests/ADT/APFloatTest.cpp b/unittests/ADT/APFloatTest.cpp index 76cdafc..b02cc3e 100644 --- a/unittests/ADT/APFloatTest.cpp +++ b/unittests/ADT/APFloatTest.cpp @@ -333,6 +333,8 @@ TEST(APFloatTest, toString) { ASSERT_EQ("1.01E-2", convertToString(1.01E-2, 5, 1)); ASSERT_EQ("0.7853981633974483", convertToString(0.78539816339744830961, 0, 3)); ASSERT_EQ("4.940656458412465E-324", convertToString(4.9406564584124654e-324, 0, 3)); + ASSERT_EQ("873.1834", convertToString(873.1834, 0, 1)); + ASSERT_EQ("8.731834E+2", convertToString(873.1834, 0, 0)); } #ifdef GTEST_HAS_DEATH_TEST |