diff options
| author | Howard Hinnant <hhinnant@apple.com> | 2013-03-08 19:06:24 +0000 |
|---|---|---|
| committer | Howard Hinnant <hhinnant@apple.com> | 2013-03-08 19:06:24 +0000 |
| commit | 7e4844b35371bcfd5cdff688a9d7346f8e982211 (patch) | |
| tree | b97b8f41bf81f23b93cd97a8d27d3d892e80a9e6 /libcxx/test | |
| parent | 5085d9b27594224856be21d2a4507269a3920e2a (diff) | |
| download | bcm5719-llvm-7e4844b35371bcfd5cdff688a9d7346f8e982211.tar.gz bcm5719-llvm-7e4844b35371bcfd5cdff688a9d7346f8e982211.zip | |
Parsing floating point numbers with very long precision was broken, and this patch fixes it. This fixes http://llvm.org/bugs/show_bug.cgi?id=15445.
llvm-svn: 176711
Diffstat (limited to 'libcxx/test')
| -rw-r--r-- | libcxx/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libcxx/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp b/libcxx/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp index 58c9b2d8be7..4e0f2b8f94a 100644 --- a/libcxx/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp +++ b/libcxx/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp @@ -240,4 +240,16 @@ int main() assert(iter.base() == str+sizeof(str)-1); assert(err == ios.failbit); } + { + v = -1; + const char str[] = "3;14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651e+10"; + std::ios_base::iostate err = ios.goodbit; + input_iterator<const char*> iter = + f.get(input_iterator<const char*>(str), + input_iterator<const char*>(str+sizeof(str)), + ios, err, v); + assert(iter.base() == str+sizeof(str)-1); + assert(err == ios.goodbit); + assert(std::abs(v - 3.14159265358979e+10)/3.14159265358979e+10 < 1.e-8); + } } |

