From df951bddb8d59ae0d12446b31ab84be36b3788c8 Mon Sep 17 00:00:00 2001 From: John McCall Date: Wed, 3 Feb 2010 03:42:44 +0000 Subject: Make APInt::countLeadingZerosSlowCase() treat the contents of padding bits as undefined. Fixes an assertion in APFloat::toString noticed by Dale. llvm-svn: 95196 --- llvm/unittests/ADT/APFloatTest.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/unittests/ADT/APFloatTest.cpp') diff --git a/llvm/unittests/ADT/APFloatTest.cpp b/llvm/unittests/ADT/APFloatTest.cpp index 76cdafcf3fe..b02cc3e3172 100644 --- a/llvm/unittests/ADT/APFloatTest.cpp +++ b/llvm/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 -- cgit v1.2.3