libcxx initial import

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@103490 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/localization/c.locales/clocale.pass.cpp b/test/localization/c.locales/clocale.pass.cpp
new file mode 100644
index 0000000..8e949ea
--- /dev/null
+++ b/test/localization/c.locales/clocale.pass.cpp
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <clocale>
+
+#include <clocale>
+#include <type_traits>
+
+#ifndef LC_ALL
+#error LC_ALL not defined
+#endif
+
+#ifndef LC_COLLATE
+#error LC_COLLATE not defined
+#endif
+
+#ifndef LC_CTYPE
+#error LC_CTYPE not defined
+#endif
+
+#ifndef LC_MONETARY
+#error LC_MONETARY not defined
+#endif
+
+#ifndef LC_NUMERIC
+#error LC_NUMERIC not defined
+#endif
+
+#ifndef LC_TIME
+#error LC_TIME not defined
+#endif
+
+#ifndef NULL
+#error NULL not defined
+#endif
+
+int main()
+{
+    std::lconv lc;
+    static_assert((std::is_same<__typeof__(std::setlocale(0, "")), char*>::value), "");
+    static_assert((std::is_same<__typeof__(std::localeconv()), std::lconv*>::value), "");
+}
diff --git a/test/localization/c.locales/version.pass.cpp b/test/localization/c.locales/version.pass.cpp
new file mode 100644
index 0000000..e6b4be8
--- /dev/null
+++ b/test/localization/c.locales/version.pass.cpp
@@ -0,0 +1,20 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <clocale>
+
+#include <clocale>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/__scan_keyword.pass.cpp b/test/localization/locale.categories/__scan_keyword.pass.cpp
new file mode 100644
index 0000000..60da89d
--- /dev/null
+++ b/test/localization/locale.categories/__scan_keyword.pass.cpp
@@ -0,0 +1,118 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// Not a portable test
+
+// __scan_keyword
+// Scans [__b, __e) until a match is found in the basic_strings range
+//  [__kb, __ke) or until it can be shown that there is no match in [__kb, __ke).
+//  __b will be incremented (visibly), consuming CharT until a match is found
+//  or proved to not exist.  A keyword may be "", in which will match anything.
+//  If one keyword is a prefix of another, and the next CharT in the input
+//  might match another keyword, the algorithm will attempt to find the longest
+//  matching keyword.  If the longer matching keyword ends up not matching, then
+//  no keyword match is found.  If no keyword match is found, __ke is returned.
+//  Else an iterator pointing to the matching keyword is found.  If more than
+//  one keyword matches, an iterator to the first matching keyword is returned.
+//  If on exit __b == __e, eofbit is set in __err.  If __case_senstive is false,
+//  __ct is used to force to lower case before comparing characters.
+//  Examples:
+//  Keywords:  "a", "abb"
+//  If the input is "a", the first keyword matches and eofbit is set.
+//  If the input is "abc", no match is found and "ab" are consumed.
+//
+// template <class _InputIterator, class _ForwardIterator, class _Ctype>
+// _ForwardIterator
+// __scan_keyword(_InputIterator& __b, _InputIterator __e,
+//                _ForwardIterator __kb, _ForwardIterator __ke,
+//                const _Ctype& __ct, ios_base::iostate& __err,
+//                bool __case_sensitive = true);
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    const std::ctype<char>& ct = std::use_facet<std::ctype<char> >(std::locale::classic());
+    std::ios_base::iostate err = std::ios_base::goodbit;
+    {
+        const char input[] = "a";
+        const char* in = input;
+        std::string keys[] = {"a", "abb"};
+        err = std::ios_base::goodbit;
+        std::string* k = std::__scan_keyword(in, input+sizeof(input)-1,
+                                             keys, keys+sizeof(keys)/sizeof(keys[0]),
+                                             ct, err);
+        assert(k - keys == 0);
+        assert(in == input+1);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char input[] = "abc";
+        const char* in = input;
+        std::string keys[] = {"a", "abb"};
+        err = std::ios_base::goodbit;
+        std::string* k = std::__scan_keyword(in, input+sizeof(input)-1,
+                                             keys, keys+sizeof(keys)/sizeof(keys[0]),
+                                             ct, err);
+        assert(k - keys == 2);
+        assert(in == input+2);
+        assert(err == std::ios_base::failbit);
+    }
+    {
+        const char input[] = "abb";
+        const char* in = input;
+        std::string keys[] = {"a", "abb"};
+        err = std::ios_base::goodbit;
+        std::string* k = std::__scan_keyword(in, input+sizeof(input)-1,
+                                             keys, keys+sizeof(keys)/sizeof(keys[0]),
+                                             ct, err);
+        assert(k - keys == 1);
+        assert(in == input+3);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char input[] = "Tue ";
+        const char* in = input;
+        std::string keys[] = {"Mon", "Monday", "Tue", "Tuesday"};
+        err = std::ios_base::goodbit;
+        std::string* k = std::__scan_keyword(in, input+sizeof(input)-1,
+                                             keys, keys+sizeof(keys)/sizeof(keys[0]),
+                                             ct, err);
+        assert(k - keys == 2);
+        assert(in == input+3);
+        assert(err == std::ios_base::goodbit);
+    }
+    {
+        const char input[] = "tue ";
+        const char* in = input;
+        std::string keys[] = {"Mon", "Monday", "Tue", "Tuesday"};
+        err = std::ios_base::goodbit;
+        std::string* k = std::__scan_keyword(in, input+sizeof(input)-1,
+                                             keys, keys+sizeof(keys)/sizeof(keys[0]),
+                                             ct, err);
+        assert(k - keys == 4);
+        assert(in == input+0);
+        assert(err == std::ios_base::failbit);
+    }
+    {
+        const char input[] = "tue ";
+        const char* in = input;
+        std::string keys[] = {"Mon", "Monday", "Tue", "Tuesday"};
+        err = std::ios_base::goodbit;
+        std::string* k = std::__scan_keyword(in, input+sizeof(input)-1,
+                                             keys, keys+sizeof(keys)/sizeof(keys[0]),
+                                             ct, err, false);
+        assert(k - keys == 2);
+        assert(in == input+3);
+        assert(err == std::ios_base::goodbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp b/test/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp
new file mode 100644
index 0000000..d8a7929
--- /dev/null
+++ b/test/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp
@@ -0,0 +1,80 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class collate_byname
+
+// int compare(const charT* low1, const charT* high1, 
+//             const charT* low2, const charT* high2) const;
+
+//  I'm currently unable to confirm that collation based on named locales
+//     has any difference from "C" collation.  But I do believe I'm picking
+//     up the OS's collation files.
+
+#include <locale>
+#include <string>
+#include <cassert>
+
+#include <stdio.h>
+
+int main()
+{
+    {
+        std::locale l("en_US");
+        {
+            const std::collate<char>& f = std::use_facet<std::collate<char> >(l);
+            std::string s2("aaaaaaA");
+            std::string s3("BaaaaaA");
+            assert(f.compare(s2.data(), s2.data() + s2.size(),
+                             s3.data(), s3.data() + s3.size()) == 1);
+        }
+        {
+            const std::collate<wchar_t>& f = std::use_facet<std::collate<wchar_t> >(l);
+            std::wstring s2(L"aaaaaaA");
+            std::wstring s3(L"BaaaaaA");
+            assert(f.compare(s2.data(), s2.data() + s2.size(),
+                             s3.data(), s3.data() + s3.size()) == 1);
+        }
+    }
+    {
+        std::locale l("");
+        {
+            const std::collate<char>& f = std::use_facet<std::collate<char> >(l);
+            std::string s2("aaaaaaA");
+            std::string s3("BaaaaaA");
+            assert(f.compare(s2.data(), s2.data() + s2.size(),
+                             s3.data(), s3.data() + s3.size()) == 1);
+        }
+        {
+            const std::collate<wchar_t>& f = std::use_facet<std::collate<wchar_t> >(l);
+            std::wstring s2(L"aaaaaaA");
+            std::wstring s3(L"BaaaaaA");
+            assert(f.compare(s2.data(), s2.data() + s2.size(),
+                             s3.data(), s3.data() + s3.size()) == 1);
+        }
+    }
+    {
+        std::locale l("C");
+        {
+            const std::collate<char>& f = std::use_facet<std::collate<char> >(l);
+            std::string s2("aaaaaaA");
+            std::string s3("BaaaaaA");
+            assert(f.compare(s2.data(), s2.data() + s2.size(),
+                             s3.data(), s3.data() + s3.size()) == 1);
+        }
+        {
+            const std::collate<wchar_t>& f = std::use_facet<std::collate<wchar_t> >(l);
+            std::wstring s2(L"aaaaaaA");
+            std::wstring s3(L"BaaaaaA");
+            assert(f.compare(s2.data(), s2.data() + s2.size(),
+                             s3.data(), s3.data() + s3.size()) == 1);
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.collate/locale.collate.byname/hash.pass.cpp b/test/localization/locale.categories/category.collate/locale.collate.byname/hash.pass.cpp
new file mode 100644
index 0000000..6f1ce94
--- /dev/null
+++ b/test/localization/locale.categories/category.collate/locale.collate.byname/hash.pass.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class collate_byname
+
+// long hash(const charT* low, const charT* high) const;
+
+//   This test is not portable
+
+#include <locale>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    std::locale l("en_US");
+    {
+        std::string x1("1234");
+        std::string x2("12345");
+        const std::collate<char>& f = std::use_facet<std::collate<char> >(l);
+        assert(f.hash(x1.data(), x1.data() + x1.size())
+            != f.hash(x2.data(), x2.data() + x2.size()));
+    }
+    {
+        std::wstring x1(L"1234");
+        std::wstring x2(L"12345");
+        const std::collate<wchar_t>& f = std::use_facet<std::collate<wchar_t> >(l);
+        assert(f.hash(x1.data(), x1.data() + x1.size())
+            != f.hash(x2.data(), x2.data() + x2.size()));
+    }
+}
diff --git a/test/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp b/test/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp
new file mode 100644
index 0000000..538a64e
--- /dev/null
+++ b/test/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp
@@ -0,0 +1,63 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class collate_byname
+
+// string_type transform(const charT* low, const charT* high) const;
+
+#include <locale>
+#include <string>
+#include <cassert>
+
+#include <stdio.h>
+
+int main()
+{
+    {
+        std::locale l("en_US");
+        {
+            std::string x("1234");
+            const std::collate<char>& f = std::use_facet<std::collate<char> >(l);
+            assert(f.transform(x.data(), x.data() + x.size()) != x);
+        }
+        {
+            std::wstring x(L"1234");
+            const std::collate<wchar_t>& f = std::use_facet<std::collate<wchar_t> >(l);
+            assert(f.transform(x.data(), x.data() + x.size()) != x);
+        }
+    }
+    {
+        std::locale l("");
+        {
+            std::string x("1234");
+            const std::collate<char>& f = std::use_facet<std::collate<char> >(l);
+            assert(f.transform(x.data(), x.data() + x.size()) != x);
+        }
+        {
+            std::wstring x(L"1234");
+            const std::collate<wchar_t>& f = std::use_facet<std::collate<wchar_t> >(l);
+            assert(f.transform(x.data(), x.data() + x.size()) != x);
+        }
+    }
+    {
+        std::locale l("C");
+        {
+            std::string x("1234");
+            const std::collate<char>& f = std::use_facet<std::collate<char> >(l);
+            assert(f.transform(x.data(), x.data() + x.size()) == x);
+        }
+        {
+            std::wstring x(L"1234");
+            const std::collate<wchar_t>& f = std::use_facet<std::collate<wchar_t> >(l);
+            assert(f.transform(x.data(), x.data() + x.size()) == x);
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.collate/locale.collate.byname/types.pass.cpp b/test/localization/locale.categories/category.collate/locale.collate.byname/types.pass.cpp
new file mode 100644
index 0000000..e819bf2
--- /dev/null
+++ b/test/localization/locale.categories/category.collate/locale.collate.byname/types.pass.cpp
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> 
+// class collate_byname
+//     : public collate<charT>
+// {
+// public: 
+//     typedef basic_string<charT> string_type; 
+//     explicit collate_byname(const char*, size_t refs = 0); 
+//     explicit collate_byname(const string&, size_t refs = 0); 
+// protected: 
+//     ~collate_byname(); 
+// };
+
+#include <locale>
+#include <string>
+#include <cassert>
+
+#include <stdio.h>
+
+int main()
+{
+    std::locale l("en_US");
+    {
+        assert(std::has_facet<std::collate_byname<char> >(l));
+        assert(&std::use_facet<std::collate<char> >(l)
+            == &std::use_facet<std::collate_byname<char> >(l));
+    }
+    {
+        assert(std::has_facet<std::collate_byname<wchar_t> >(l));
+        assert(&std::use_facet<std::collate<wchar_t> >(l)
+            == &std::use_facet<std::collate_byname<wchar_t> >(l));
+    }
+}
diff --git a/test/localization/locale.categories/category.collate/locale.collate/ctor.pass.cpp b/test/localization/locale.categories/category.collate/locale.collate/ctor.pass.cpp
new file mode 100644
index 0000000..07eece2
--- /dev/null
+++ b/test/localization/locale.categories/category.collate/locale.collate/ctor.pass.cpp
@@ -0,0 +1,67 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class collate;
+
+// explicit collate(size_t refs = 0);
+
+#include <locale>
+#include <type_traits>
+#include <cassert>
+
+template <class C>
+class my_facet
+    : public std::collate<C>
+{
+public:
+    static int count;
+
+    explicit my_facet(std::size_t refs = 0)
+        : std::collate<C>(refs) {++count;}
+
+    ~my_facet() {--count;}
+};
+
+template <class C> int my_facet<C>::count = 0;
+
+int main()
+{
+    {
+        std::locale l(std::locale::classic(), new my_facet<char>);
+        assert(my_facet<char>::count == 1);
+    }
+    assert(my_facet<char>::count == 0);
+    {
+        my_facet<char> f(1);
+        assert(my_facet<char>::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet<char>::count == 1);
+        }
+        assert(my_facet<char>::count == 1);
+    }
+    assert(my_facet<char>::count == 0);
+    {
+        std::locale l(std::locale::classic(), new my_facet<wchar_t>);
+        assert(my_facet<wchar_t>::count == 1);
+    }
+    assert(my_facet<wchar_t>::count == 0);
+    {
+        my_facet<wchar_t> f(1);
+        assert(my_facet<wchar_t>::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet<wchar_t>::count == 1);
+        }
+        assert(my_facet<wchar_t>::count == 1);
+    }
+    assert(my_facet<wchar_t>::count == 0);
+}
diff --git a/test/localization/locale.categories/category.collate/locale.collate/locale.collate.members/compare.pass.cpp b/test/localization/locale.categories/category.collate/locale.collate/locale.collate.members/compare.pass.cpp
new file mode 100644
index 0000000..06785c3
--- /dev/null
+++ b/test/localization/locale.categories/category.collate/locale.collate/locale.collate.members/compare.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class collate;
+
+// int compare(const charT* low1, const charT* high1, 
+//             const charT* low2, const charT* high2) const;
+
+#include <locale>
+#include <cassert>
+
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        const char ia[] = "1234";
+        const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+        const char ib[] = "123";
+        const std::collate<char>& f = std::use_facet<std::collate<char> >(l);
+        assert(f.compare(ia, ia+sa, ib, ib+2) == 1);
+        assert(f.compare(ib, ib+2, ia, ia+sa) == -1);
+        assert(f.compare(ia, ia+sa, ib, ib+3) == 1);
+        assert(f.compare(ib, ib+3, ia, ia+sa) == -1);
+        assert(f.compare(ia, ia+sa, ib+1, ib+3) == -1);
+        assert(f.compare(ib+1, ib+3, ia, ia+sa) == 1);
+        assert(f.compare(ia, ia+3, ib, ib+3) == 0);
+    }
+    {
+        const wchar_t ia[] = L"1234";
+        const unsigned sa = sizeof(ia)/sizeof(ia[0]);
+        const wchar_t ib[] = L"123";
+        const std::collate<wchar_t>& f = std::use_facet<std::collate<wchar_t> >(l);
+        assert(f.compare(ia, ia+sa, ib, ib+2) == 1);
+        assert(f.compare(ib, ib+2, ia, ia+sa) == -1);
+        assert(f.compare(ia, ia+sa, ib, ib+3) == 1);
+        assert(f.compare(ib, ib+3, ia, ia+sa) == -1);
+        assert(f.compare(ia, ia+sa, ib+1, ib+3) == -1);
+        assert(f.compare(ib+1, ib+3, ia, ia+sa) == 1);
+        assert(f.compare(ia, ia+3, ib, ib+3) == 0);
+    }
+}
diff --git a/test/localization/locale.categories/category.collate/locale.collate/locale.collate.members/hash.pass.cpp b/test/localization/locale.categories/category.collate/locale.collate/locale.collate.members/hash.pass.cpp
new file mode 100644
index 0000000..8395945
--- /dev/null
+++ b/test/localization/locale.categories/category.collate/locale.collate/locale.collate.members/hash.pass.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class collate;
+
+// long hash(const charT* low, const charT* high) const;
+
+//   This test is not portable
+
+#include <locale>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        std::string x1("1234");
+        std::string x2("12345");
+        const std::collate<char>& f = std::use_facet<std::collate<char> >(l);
+        assert(f.hash(x1.data(), x1.data() + x1.size())
+            != f.hash(x2.data(), x2.data() + x2.size()));
+    }
+    {
+        std::wstring x1(L"1234");
+        std::wstring x2(L"12345");
+        const std::collate<wchar_t>& f = std::use_facet<std::collate<wchar_t> >(l);
+        assert(f.hash(x1.data(), x1.data() + x1.size())
+            != f.hash(x2.data(), x2.data() + x2.size()));
+    }
+}
diff --git a/test/localization/locale.categories/category.collate/locale.collate/locale.collate.members/transform.pass.cpp b/test/localization/locale.categories/category.collate/locale.collate/locale.collate.members/transform.pass.cpp
new file mode 100644
index 0000000..6afcbaf
--- /dev/null
+++ b/test/localization/locale.categories/category.collate/locale.collate/locale.collate.members/transform.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class collate;
+
+// string_type transform(const charT* low, const charT* high) const;
+
+#include <locale>
+#include <string>
+#include <cassert>
+
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        std::string x("1234");
+        const std::collate<char>& f = std::use_facet<std::collate<char> >(l);
+        assert(f.transform(x.data(), x.data() + x.size()) == x);
+    }
+    {
+        std::wstring x(L"1234");
+        const std::collate<wchar_t>& f = std::use_facet<std::collate<wchar_t> >(l);
+        assert(f.transform(x.data(), x.data() + x.size()) == x);
+    }
+}
diff --git a/test/localization/locale.categories/category.collate/locale.collate/locale.collate.virtuals/tested_elsewhere.pass.cpp b/test/localization/locale.categories/category.collate/locale.collate/locale.collate.virtuals/tested_elsewhere.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/category.collate/locale.collate/locale.collate.virtuals/tested_elsewhere.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/category.collate/locale.collate/types.pass.cpp b/test/localization/locale.categories/category.collate/locale.collate/types.pass.cpp
new file mode 100644
index 0000000..bf0277f
--- /dev/null
+++ b/test/localization/locale.categories/category.collate/locale.collate/types.pass.cpp
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> 
+// class collate
+//     : public locale::facet { 
+// public: 
+//     typedef charT char_type; 
+//     typedef basic_string<charT>string_type;
+// 
+//     static locale::id id;
+// };
+
+#include <locale>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        assert(std::has_facet<std::collate<char> >(l));
+        const std::collate<char>& f = std::use_facet<std::collate<char> >(l);
+        {
+            (void)std::collate<char>::id;
+        }
+        static_assert((std::is_same<std::collate<char>::char_type, char>::value), "");
+        static_assert((std::is_same<std::collate<char>::string_type, std::string>::value), "");
+        static_assert((std::is_base_of<std::locale::facet, std::collate<char> >::value), "");
+    }
+    {
+        assert(std::has_facet<std::collate<wchar_t> >(l));
+        const std::collate<wchar_t>& f = std::use_facet<std::collate<wchar_t> >(l);
+        {
+            (void)std::collate<wchar_t>::id;
+        }
+        static_assert((std::is_same<std::collate<wchar_t>::char_type, wchar_t>::value), "");
+        static_assert((std::is_same<std::collate<wchar_t>::string_type, std::wstring>::value), "");
+        static_assert((std::is_base_of<std::locale::facet, std::collate<wchar_t> >::value), "");
+    }
+}
diff --git a/test/localization/locale.categories/category.collate/nothing_to_do.pass.cpp b/test/localization/locale.categories/category.collate/nothing_to_do.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/category.collate/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/category.ctype/ctype_base.pass.cpp b/test/localization/locale.categories/category.ctype/ctype_base.pass.cpp
new file mode 100644
index 0000000..fbe88a8
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/ctype_base.pass.cpp
@@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class ctype_base
+// { 
+// public: 
+//     typedef T mask; 
+// 
+//     // numeric values are for exposition only. 
+//     static const mask space = 1 << 0; 
+//     static const mask print = 1 << 1; 
+//     static const mask cntrl = 1 << 2; 
+//     static const mask upper = 1 << 3; 
+//     static const mask lower = 1 << 4; 
+//     static const mask alpha = 1 << 5; 
+//     static const mask digit = 1 << 6; 
+//     static const mask punct = 1 << 7; 
+//     static const mask xdigit = 1 << 8; 
+//     static const mask alnum = alpha | digit; 
+//     static const mask graph = alnum | punct; 
+// };
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    assert(std::ctype_base::space);
+    assert(std::ctype_base::print);
+    assert(std::ctype_base::cntrl);
+    assert(std::ctype_base::upper);
+    assert(std::ctype_base::lower);
+    assert(std::ctype_base::alpha);
+    assert(std::ctype_base::digit);
+    assert(std::ctype_base::punct);
+    assert(std::ctype_base::xdigit);
+    assert(
+      ( std::ctype_base::space
+      & std::ctype_base::print
+      & std::ctype_base::cntrl
+      & std::ctype_base::upper
+      & std::ctype_base::lower
+      & std::ctype_base::alpha
+      & std::ctype_base::digit
+      & std::ctype_base::punct
+      & std::ctype_base::xdigit) == 0);
+    assert(std::ctype_base::alnum == (std::ctype_base::alpha | std::ctype_base::digit));
+    assert(std::ctype_base::graph == (std::ctype_base::alnum | std::ctype_base::punct));
+}
\ No newline at end of file
diff --git a/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.dtor/dtor.pass.cpp b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.dtor/dtor.pass.cpp
new file mode 100644
index 0000000..bac1a3a
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.dtor/dtor.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class ctype<char>
+
+// ~ctype();
+
+#include <locale>
+#include <cassert>
+#include <new>
+
+unsigned delete_called = 0;
+
+void operator delete[](void* p) throw()
+{
+    operator delete(p);
+    ++delete_called;
+}
+
+int main()
+{
+    {
+        delete_called = 0;
+        std::locale l(std::locale::classic(), new std::ctype<char>);
+        assert(delete_called == 0);
+    }
+    assert(delete_called == 0);
+    {
+        std::ctype<char>::mask table[256];
+        delete_called = 0;
+        std::locale l(std::locale::classic(), new std::ctype<char>(table));
+        assert(delete_called == 0);
+    }
+    assert(delete_called == 0);
+    {
+        delete_called = 0;
+        std::locale l(std::locale::classic(),
+            new std::ctype<char>(new std::ctype<char>::mask[256], true));
+        assert(delete_called == 0);
+    }
+    assert(delete_called == 1);
+}
diff --git a/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/ctor.pass.cpp b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/ctor.pass.cpp
new file mode 100644
index 0000000..bde9ebd
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/ctor.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype;
+
+// explicit ctype(const mask* tbl = 0, bool del = false, size_t refs = 0);
+
+#include <locale>
+#include <cassert>
+
+class my_facet
+    : public std::ctype<char>
+{
+public:
+    static int count;
+
+    explicit my_facet(const mask* tbl = 0, bool del = false, std::size_t refs = 0)
+        : std::ctype<char>(tbl, del, refs) {++count;}
+
+    ~my_facet() {--count;}
+};
+
+int my_facet::count = 0;
+
+int main()
+{
+    {
+        std::locale l(std::locale::classic(), new my_facet);
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f(0, false, 1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+}
diff --git a/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/is_1.pass.cpp b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/is_1.pass.cpp
new file mode 100644
index 0000000..eeddea8
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/is_1.pass.cpp
@@ -0,0 +1,59 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class ctype<char>;
+
+// bool is(mask m, char c) const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<char> F;
+        const F& f = std::use_facet<F>(l);
+
+        assert(f.is(F::space, ' '));
+        assert(!f.is(F::space, 'A'));
+
+        assert(f.is(F::print, ' '));
+        assert(!f.is(F::print, '\x07'));
+
+        assert(f.is(F::cntrl, '\x07'));
+        assert(!f.is(F::cntrl, ' '));
+
+        assert(f.is(F::upper, 'A'));
+        assert(!f.is(F::upper, 'a'));
+
+        assert(f.is(F::lower, 'a'));
+        assert(!f.is(F::lower, 'A'));
+
+        assert(f.is(F::alpha, 'a'));
+        assert(!f.is(F::alpha, '1'));
+
+        assert(f.is(F::digit, '1'));
+        assert(!f.is(F::digit, 'a'));
+
+        assert(f.is(F::punct, '.'));
+        assert(!f.is(F::punct, 'a'));
+
+        assert(f.is(F::xdigit, 'a'));
+        assert(!f.is(F::xdigit, 'g'));
+
+        assert(f.is(F::alnum, 'a'));
+        assert(!f.is(F::alnum, '.'));
+
+        assert(f.is(F::graph, '.'));
+        assert(!f.is(F::graph,  '\x07'));
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/is_many.pass.cpp b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/is_many.pass.cpp
new file mode 100644
index 0000000..0c228c5
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/is_many.pass.cpp
@@ -0,0 +1,118 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class ctype<char>;
+
+// const char* is(const char* low, const char* high, mask* vec) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+#include <stdio.h>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<char> F;
+        const F& f = std::use_facet<F>(l);
+        const std::string in(" A\x07.a1");
+        std::vector<F::mask> m(in.size());
+        const char* h = f.is(in.data(), in.data() + in.size(), m.data());
+        assert(h == in.data() + in.size());
+
+        // ' '
+        assert( (m[0] & F::space));
+        assert( (m[0] & F::print));
+        assert(!(m[0] & F::cntrl));
+        assert(!(m[0] & F::upper));
+        assert(!(m[0] & F::lower));
+        assert(!(m[0] & F::alpha));
+        assert(!(m[0] & F::digit));
+        assert(!(m[0] & F::punct));
+        assert(!(m[0] & F::xdigit));
+        assert( (m[0] & F::blank));
+        assert(!(m[0] & F::alnum));
+        assert(!(m[0] & F::graph));
+
+        // 'A'
+        assert(!(m[1] & F::space));
+        assert( (m[1] & F::print));
+        assert(!(m[1] & F::cntrl));
+        assert( (m[1] & F::upper));
+        assert(!(m[1] & F::lower));
+        assert( (m[1] & F::alpha));
+        assert(!(m[1] & F::digit));
+        assert(!(m[1] & F::punct));
+        assert( (m[1] & F::xdigit));
+        assert(!(m[1] & F::blank));
+        assert( (m[1] & F::alnum));
+        assert( (m[1] & F::graph));
+
+        // '\x07'
+        assert(!(m[2] & F::space));
+        assert(!(m[2] & F::print));
+        assert( (m[2] & F::cntrl));
+        assert(!(m[2] & F::upper));
+        assert(!(m[2] & F::lower));
+        assert(!(m[2] & F::alpha));
+        assert(!(m[2] & F::digit));
+        assert(!(m[2] & F::punct));
+        assert(!(m[2] & F::xdigit));
+        assert(!(m[2] & F::blank));
+        assert(!(m[2] & F::alnum));
+        assert(!(m[2] & F::graph));
+
+        // '.'
+        assert(!(m[3] & F::space));
+        assert( (m[3] & F::print));
+        assert(!(m[3] & F::cntrl));
+        assert(!(m[3] & F::upper));
+        assert(!(m[3] & F::lower));
+        assert(!(m[3] & F::alpha));
+        assert(!(m[3] & F::digit));
+        assert( (m[3] & F::punct));
+        assert(!(m[3] & F::xdigit));
+        assert(!(m[3] & F::blank));
+        assert(!(m[3] & F::alnum));
+        assert( (m[3] & F::graph));
+
+        // 'a'
+        assert(!(m[4] & F::space));
+        assert( (m[4] & F::print));
+        assert(!(m[4] & F::cntrl));
+        assert(!(m[4] & F::upper));
+        assert( (m[4] & F::lower));
+        assert( (m[4] & F::alpha));
+        assert(!(m[4] & F::digit));
+        assert(!(m[4] & F::punct));
+        assert( (m[4] & F::xdigit));
+        assert(!(m[4] & F::blank));
+        assert( (m[4] & F::alnum));
+        assert( (m[4] & F::graph));
+
+        // '1'
+        assert(!(m[5] & F::space));
+        assert( (m[5] & F::print));
+        assert(!(m[5] & F::cntrl));
+        assert(!(m[5] & F::upper));
+        assert(!(m[5] & F::lower));
+        assert(!(m[5] & F::alpha));
+        assert( (m[5] & F::digit));
+        assert(!(m[5] & F::punct));
+        assert( (m[5] & F::xdigit));
+        assert(!(m[5] & F::blank));
+        assert( (m[5] & F::alnum));
+        assert( (m[5] & F::graph));
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/narrow_1.pass.cpp b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/narrow_1.pass.cpp
new file mode 100644
index 0000000..45ca8a4
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/narrow_1.pass.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class ctype<char>;
+
+// char narrow(char c, char dfault) const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<char> F;
+        const F& f = std::use_facet<F>(l);
+
+        assert(f.narrow(' ', '*') == ' ');
+        assert(f.narrow('A', '*') == 'A');
+        assert(f.narrow('\x07', '*') == '\x07');
+        assert(f.narrow('.', '*') == '.');
+        assert(f.narrow('a', '*') == 'a');
+        assert(f.narrow('1', '*') == '1');
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/narrow_many.pass.cpp b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/narrow_many.pass.cpp
new file mode 100644
index 0000000..d4816c4
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/narrow_many.pass.cpp
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class ctype<char>;
+
+// const char* narrow(const char* low, const char*, char dfault, char* to) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<char> F;
+        const F& f = std::use_facet<F>(l);
+        std::string in(" A\x07.a1");
+        std::vector<char> v(in.size());
+
+        assert(f.narrow(&in[0], in.data() + in.size(), '*', v.data()) == in.data() + in.size());
+        assert(v[0] == ' ');
+        assert(v[1] == 'A');
+        assert(v[2] == '\x07');
+        assert(v[3] == '.');
+        assert(v[4] == 'a');
+        assert(v[5] == '1');
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/scan_is.pass.cpp b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/scan_is.pass.cpp
new file mode 100644
index 0000000..1e2db54
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/scan_is.pass.cpp
@@ -0,0 +1,44 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class ctype<char>;
+
+// const char* scan_is(mask m, const char* low, const char* high) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+#include <stdio.h>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<char> F;
+        const F& f = std::use_facet<F>(l);
+        const std::string in(" A\x07.a1");
+        std::vector<F::mask> m(in.size());
+        assert(f.scan_is(F::space, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_is(F::print, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_is(F::cntrl, in.data(), in.data() + in.size()) - in.data() == 2);
+        assert(f.scan_is(F::upper, in.data(), in.data() + in.size()) - in.data() == 1);
+        assert(f.scan_is(F::lower, in.data(), in.data() + in.size()) - in.data() == 4);
+        assert(f.scan_is(F::alpha, in.data(), in.data() + in.size()) - in.data() == 1);
+        assert(f.scan_is(F::digit, in.data(), in.data() + in.size()) - in.data() == 5);
+        assert(f.scan_is(F::punct, in.data(), in.data() + in.size()) - in.data() == 3);
+        assert(f.scan_is(F::xdigit, in.data(), in.data() + in.size()) - in.data() == 1);
+        assert(f.scan_is(F::blank, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_is(F::alnum, in.data(), in.data() + in.size()) - in.data() == 1);
+        assert(f.scan_is(F::graph, in.data(), in.data() + in.size()) - in.data() == 1);
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/scan_not.pass.cpp b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/scan_not.pass.cpp
new file mode 100644
index 0000000..4859c04
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/scan_not.pass.cpp
@@ -0,0 +1,44 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class ctype<char>;
+
+// const char* scan_not(mask m, const char* low, const char* high) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+#include <stdio.h>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<char> F;
+        const F& f = std::use_facet<F>(l);
+        const std::string in(" A\x07.a1");
+        std::vector<F::mask> m(in.size());
+        assert(f.scan_not(F::space, in.data(), in.data() + in.size()) - in.data() == 1);
+        assert(f.scan_not(F::print, in.data(), in.data() + in.size()) - in.data() == 2);
+        assert(f.scan_not(F::cntrl, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_not(F::upper, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_not(F::lower, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_not(F::alpha, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_not(F::digit, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_not(F::punct, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_not(F::xdigit, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_not(F::blank, in.data(), in.data() + in.size()) - in.data() == 1);
+        assert(f.scan_not(F::alnum, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_not(F::graph, in.data(), in.data() + in.size()) - in.data() == 0);
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/table.pass.cpp b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/table.pass.cpp
new file mode 100644
index 0000000..1b9d77e
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/table.pass.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class ctype<char>
+
+// const mask* table() const throw();
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    typedef std::ctype<char> F;
+    {
+        std::locale l(std::locale::classic(), new std::ctype<char>);
+        const F& f = std::use_facet<F>(l);
+        assert(f.table() == f.classic_table());
+    }
+    {
+        std::ctype<char>::mask table[256];
+        std::locale l(std::locale::classic(), new std::ctype<char>(table));
+        const F& f = std::use_facet<F>(l);
+        assert(f.table() == table);
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/tolower_1.pass.cpp b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/tolower_1.pass.cpp
new file mode 100644
index 0000000..8e3f397
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/tolower_1.pass.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class ctype<char>;
+
+// char tolower(char) const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<char> F;
+        const F& f = std::use_facet<F>(l);
+
+        assert(f.tolower(' ') == ' ');
+        assert(f.tolower('A') == 'a');
+        assert(f.tolower('\x07') == '\x07');
+        assert(f.tolower('.') == '.');
+        assert(f.tolower('a') == 'a');
+        assert(f.tolower('1') == '1');
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/tolower_many.pass.cpp b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/tolower_many.pass.cpp
new file mode 100644
index 0000000..2263c00
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/tolower_many.pass.cpp
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class ctype<char>;
+
+// const char* tolower(char* low, const char* high) const;
+
+#include <locale>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<char> F;
+        const F& f = std::use_facet<F>(l);
+        std::string in(" A\x07.a1");
+
+        assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size());
+        assert(in[0] == ' ');
+        assert(in[1] == 'a');
+        assert(in[2] == '\x07');
+        assert(in[3] == '.');
+        assert(in[4] == 'a');
+        assert(in[5] == '1');
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/toupper_1.pass.cpp b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/toupper_1.pass.cpp
new file mode 100644
index 0000000..ce0e4a1
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/toupper_1.pass.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class ctype<char>;
+
+// char toupper(char) const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<char> F;
+        const F& f = std::use_facet<F>(l);
+
+        assert(f.toupper(' ') == ' ');
+        assert(f.toupper('A') == 'A');
+        assert(f.toupper('\x07') == '\x07');
+        assert(f.toupper('.') == '.');
+        assert(f.toupper('a') == 'A');
+        assert(f.toupper('1') == '1');
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/toupper_many.pass.cpp b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/toupper_many.pass.cpp
new file mode 100644
index 0000000..5e5e684
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/toupper_many.pass.cpp
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class ctype<char>;
+
+// const char* toupper(char* low, const char* high) const;
+
+#include <locale>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<char> F;
+        const F& f = std::use_facet<F>(l);
+        std::string in(" A\x07.a1");
+
+        assert(f.toupper(&in[0], in.data() + in.size()) == in.data() + in.size());
+        assert(in[0] == ' ');
+        assert(in[1] == 'A');
+        assert(in[2] == '\x07');
+        assert(in[3] == '.');
+        assert(in[4] == 'A');
+        assert(in[5] == '1');
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/widen_1.pass.cpp b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/widen_1.pass.cpp
new file mode 100644
index 0000000..d5dde81
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/widen_1.pass.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class ctype<char>;
+
+// char widen(char c) const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<char> F;
+        const F& f = std::use_facet<F>(l);
+
+        assert(f.widen(' ') == ' ');
+        assert(f.widen('A') == 'A');
+        assert(f.widen('\x07') == '\x07');
+        assert(f.widen('.') == '.');
+        assert(f.widen('a') == 'a');
+        assert(f.widen('1') == '1');
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/widen_many.pass.cpp b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/widen_many.pass.cpp
new file mode 100644
index 0000000..24ac66e
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.members/widen_many.pass.cpp
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class ctype<char>;
+
+// const char* widen(const char* low, const char* high, char* to) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<char> F;
+        const F& f = std::use_facet<F>(l);
+        std::string in(" A\x07.a1");
+        std::vector<char> v(in.size());
+
+        assert(f.widen(&in[0], in.data() + in.size(), v.data()) == in.data() + in.size());
+        assert(v[0] == ' ');
+        assert(v[1] == 'A');
+        assert(v[2] == '\x07');
+        assert(v[3] == '.');
+        assert(v[4] == 'a');
+        assert(v[5] == '1');
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp
new file mode 100644
index 0000000..aa3a9dd
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp
@@ -0,0 +1,23 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class ctype<char>
+
+// static const mask* classic_table() throw();
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    typedef std::ctype<char> F;
+    assert(F::classic_table() != 0);
+}
diff --git a/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.virtuals/tested_elsewhere.pass.cpp b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.virtuals/tested_elsewhere.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.virtuals/tested_elsewhere.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/category.ctype/facet.ctype.special/types.pass.cpp b/test/localization/locale.categories/category.ctype/facet.ctype.special/types.pass.cpp
new file mode 100644
index 0000000..1f01852
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/facet.ctype.special/types.pass.cpp
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> 
+// class ctype<char>
+//     : public locale::facet,
+//       public ctype_base
+// {
+// public: 
+//     typedef char char_type; 
+// };
+
+#include <locale>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        assert(std::has_facet<std::ctype<char> >(l));
+        const std::ctype<char>& f = std::use_facet<std::ctype<char> >(l);
+        {
+            (void)std::ctype<char>::id;
+        }
+        static_assert((std::is_same<std::ctype<char>::char_type, char>::value), "");
+        static_assert((std::is_base_of<std::ctype_base, std::ctype<char> >::value), "");
+        static_assert((std::is_base_of<std::locale::facet, std::ctype<char> >::value), "");
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char.pass.cpp
new file mode 100644
index 0000000..2ae467a
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt_byname<char, char, mbstate_t>
+
+// explicit codecvt_byname(const char* nm, size_t refs = 0);
+// explicit codecvt_byname(const string& nm, size_t refs = 0);
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt_byname<char, char, std::mbstate_t> F;
+
+class my_facet
+    : public F
+{
+public:
+    static int count;
+
+    explicit my_facet(const char* nm, std::size_t refs = 0)
+        : F(nm, refs) {++count;}
+    explicit my_facet(const std::string& nm, std::size_t refs = 0)
+        : F(nm, refs) {++count;}
+
+    ~my_facet() {--count;}
+};
+
+int my_facet::count = 0;
+
+int main()
+{
+    {
+        std::locale l(std::locale::classic(), new my_facet("en_US"));
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f("en_US", 1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        std::locale l(std::locale::classic(), new my_facet(std::string("en_US")));
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f(std::string("en_US"), 1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t.pass.cpp
new file mode 100644
index 0000000..f5c1a6d
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char16_t.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt_byname<char16_t, char, mbstate_t>
+
+// explicit codecvt_byname(const char* nm, size_t refs = 0);
+// explicit codecvt_byname(const string& nm, size_t refs = 0);
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt_byname<char16_t, char, std::mbstate_t> F;
+
+class my_facet
+    : public F
+{
+public:
+    static int count;
+
+    explicit my_facet(const char* nm, std::size_t refs = 0)
+        : F(nm, refs) {++count;}
+    explicit my_facet(const std::string& nm, std::size_t refs = 0)
+        : F(nm, refs) {++count;}
+
+    ~my_facet() {--count;}
+};
+
+int my_facet::count = 0;
+
+int main()
+{
+    {
+        std::locale l(std::locale::classic(), new my_facet("en_US"));
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f("en_US", 1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        std::locale l(std::locale::classic(), new my_facet(std::string("en_US")));
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f(std::string("en_US"), 1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char32_t.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char32_t.pass.cpp
new file mode 100644
index 0000000..f38ea15
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char32_t.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt_byname<char32_t, char, mbstate_t>
+
+// explicit codecvt_byname(const char* nm, size_t refs = 0);
+// explicit codecvt_byname(const string& nm, size_t refs = 0);
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt_byname<char32_t, char, std::mbstate_t> F;
+
+class my_facet
+    : public F
+{
+public:
+    static int count;
+
+    explicit my_facet(const char* nm, std::size_t refs = 0)
+        : F(nm, refs) {++count;}
+    explicit my_facet(const std::string& nm, std::size_t refs = 0)
+        : F(nm, refs) {++count;}
+
+    ~my_facet() {--count;}
+};
+
+int my_facet::count = 0;
+
+int main()
+{
+    {
+        std::locale l(std::locale::classic(), new my_facet("en_US"));
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f("en_US", 1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        std::locale l(std::locale::classic(), new my_facet(std::string("en_US")));
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f(std::string("en_US"), 1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_wchar_t.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_wchar_t.pass.cpp
new file mode 100644
index 0000000..ccc183f
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_wchar_t.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt_byname<wchar_t, char, mbstate_t>
+
+// explicit codecvt_byname(const char* nm, size_t refs = 0);
+// explicit codecvt_byname(const string& nm, size_t refs = 0);
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt_byname<wchar_t, char, std::mbstate_t> F;
+
+class my_facet
+    : public F
+{
+public:
+    static int count;
+
+    explicit my_facet(const char* nm, std::size_t refs = 0)
+        : F(nm, refs) {++count;}
+    explicit my_facet(const std::string& nm, std::size_t refs = 0)
+        : F(nm, refs) {++count;}
+
+    ~my_facet() {--count;}
+};
+
+int my_facet::count = 0;
+
+int main()
+{
+    {
+        std::locale l(std::locale::classic(), new my_facet("en_US"));
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f("en_US", 1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        std::locale l(std::locale::classic(), new my_facet(std::string("en_US")));
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f(std::string("en_US"), 1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/codecvt_base.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/codecvt_base.pass.cpp
new file mode 100644
index 0000000..60ca4fd
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/codecvt_base.pass.cpp
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class codecvt_base
+// {
+// public: 
+//     enum result {ok, partial, error, noconv};
+// };
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    assert(std::codecvt_base::ok == 0);
+    assert(std::codecvt_base::partial == 1);
+    assert(std::codecvt_base::error == 2);
+    assert(std::codecvt_base::noconv == 3);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/ctor_char.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/ctor_char.pass.cpp
new file mode 100644
index 0000000..69b76b2
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/ctor_char.pass.cpp
@@ -0,0 +1,52 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char, char, mbstate_t>
+
+// explicit codecvt(size_t refs = 0);
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt<char, char, std::mbstate_t> F;
+
+class my_facet
+    : public F
+{
+public:
+    static int count;
+
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {++count;}
+
+    ~my_facet() {--count;}
+};
+
+int my_facet::count = 0;
+
+int main()
+{
+    {
+        std::locale l(std::locale::classic(), new my_facet);
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f(1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/ctor_char16_t.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/ctor_char16_t.pass.cpp
new file mode 100644
index 0000000..79d6cd2
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/ctor_char16_t.pass.cpp
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char16_t, char, mbstate_t>
+
+// explicit codecvt(size_t refs = 0);
+
+#include <locale>
+#include <cassert>
+
+//#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
+
+typedef std::codecvt<char16_t, char, std::mbstate_t> F;
+
+class my_facet
+    : public F
+{
+public:
+    static int count;
+
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {++count;}
+
+    ~my_facet() {--count;}
+};
+
+int my_facet::count = 0;
+
+//#endif
+
+int main()
+{
+//#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
+    {
+        std::locale l(std::locale::classic(), new my_facet);
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f(1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+//#endif
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/ctor_char32_t.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/ctor_char32_t.pass.cpp
new file mode 100644
index 0000000..41a7dfb
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/ctor_char32_t.pass.cpp
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char32_t, char, mbstate_t>
+
+// explicit codecvt(size_t refs = 0);
+
+#include <locale>
+#include <cassert>
+
+//#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
+
+typedef std::codecvt<char32_t, char, std::mbstate_t> F;
+
+class my_facet
+    : public F
+{
+public:
+    static int count;
+
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {++count;}
+
+    ~my_facet() {--count;}
+};
+
+int my_facet::count = 0;
+
+//#endif
+
+int main()
+{
+//#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
+    {
+        std::locale l(std::locale::classic(), new my_facet);
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f(1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+//#endif
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/ctor_wchar_t.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/ctor_wchar_t.pass.cpp
new file mode 100644
index 0000000..096b1b9
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/ctor_wchar_t.pass.cpp
@@ -0,0 +1,52 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<wchar_t, char, mbstate_t>
+
+// explicit codecvt(size_t refs = 0);
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt<wchar_t, char, std::mbstate_t> F;
+
+class my_facet
+    : public F
+{
+public:
+    static int count;
+
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {++count;}
+
+    ~my_facet() {--count;}
+};
+
+int my_facet::count = 0;
+
+int main()
+{
+    {
+        std::locale l(std::locale::classic(), new my_facet);
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f(1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp
new file mode 100644
index 0000000..43d21df
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_always_noconv.pass.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char16_t, char, mbstate_t>
+
+// bool always_noconv() const throw();
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt<char16_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const F& f = std::use_facet<F>(l);
+    assert(!f.always_noconv());
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_encoding.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_encoding.pass.cpp
new file mode 100644
index 0000000..3249404
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_encoding.pass.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char16_t, char, mbstate_t>
+
+// int encoding() const throw();
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt<char16_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const F& f = std::use_facet<F>(l);
+    assert(f.encoding() == 0);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp
new file mode 100644
index 0000000..71800ff
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_in.pass.cpp
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char16_t, char, mbstate_t>
+
+// result in(stateT& state, 
+//           const externT* from, const externT* from_end, const externT*& from_next, 
+//           internT* to, internT* to_end, internT*& to_next) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+typedef std::codecvt<char16_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const char from[] = "some text";
+    F::intern_type to[9];
+    const F& f = std::use_facet<F>(l);
+    std::mbstate_t mbs;
+    const char* from_next = 0;
+    F::intern_type* to_next = 0;
+    assert(f.in(mbs, from, from + 9, from_next,
+                     to, to + 9, to_next) == F::ok);
+    assert(from_next - from == 9);
+    assert(to_next - to == 9);
+    for (unsigned i = 0; i < 9; ++i)
+        assert(to[i] == from[i]);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp
new file mode 100644
index 0000000..b642160
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_length.pass.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char16_t, char, mbstate_t>
+
+// int length(stateT& state, const externT* from, const externT* from_end, size_t max) const;
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt<char16_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const F& f = std::use_facet<F>(l);
+    std::mbstate_t mbs;
+    const char from[] = "some text";
+    assert(f.length(mbs, from, from+10, 0) == 0);
+    assert(f.length(mbs, from, from+10, 8) == 8);
+    assert(f.length(mbs, from, from+10, 9) == 9);
+    assert(f.length(mbs, from, from+10, 10) == 10);
+    assert(f.length(mbs, from, from+10, 100) == 10);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_max_length.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_max_length.pass.cpp
new file mode 100644
index 0000000..e4346b1
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_max_length.pass.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char16_t, char, mbstate_t>
+
+// int max_length() const throw();
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt<char16_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const F& f = std::use_facet<F>(l);
+    assert(f.max_length() == 4);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp
new file mode 100644
index 0000000..978075f
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_out.pass.cpp
@@ -0,0 +1,45 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char16_t, char, mbstate_t>
+
+// result out(stateT& state, 
+//            const internT* from, const internT* from_end, const internT*& from_next, 
+//            externT* to, externT* to_end, externT*& to_next) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+#include <stdio.h>
+
+typedef std::codecvt<char16_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const F& f = std::use_facet<F>(l);
+    {
+        F::intern_type from[9] = {'s', 'o', 'm', 'e', ' ', 't', 'e', 'x', 't'};
+        char to[9] = {0};
+        std::mbstate_t mbs;
+        const F::intern_type* from_next = 0;
+        char* to_next = 0;
+        F::result r = f.out(mbs, from, from + 9, from_next,
+                                 to, to + 9, to_next);
+        assert(r == F::ok);
+        assert(from_next - from == 9);
+        assert(to_next - to == 9);
+        for (unsigned i = 0; i < 9; ++i)
+            assert(to[i] == from[i]);
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp
new file mode 100644
index 0000000..484c29b
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char16_t_unshift.pass.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char16_t, char, mbstate_t>
+
+// result unshift(stateT& state,
+//                externT* to, externT* to_end, externT*& to_next) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+typedef std::codecvt<char16_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    std::vector<char> to(3);
+    const F& f = std::use_facet<F>(l);
+    std::mbstate_t mbs;
+    char* to_next = 0;
+    assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::noconv);
+    assert(to_next == to.data());
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_always_noconv.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_always_noconv.pass.cpp
new file mode 100644
index 0000000..93ee795
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_always_noconv.pass.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char32_t, char, mbstate_t>
+
+// bool always_noconv() const throw();
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt<char32_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const F& f = std::use_facet<F>(l);
+    assert(!f.always_noconv());
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_encoding.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_encoding.pass.cpp
new file mode 100644
index 0000000..fa982c9
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_encoding.pass.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char32_t, char, mbstate_t>
+
+// int encoding() const throw();
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt<char32_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const F& f = std::use_facet<F>(l);
+    assert(f.encoding() == 0);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp
new file mode 100644
index 0000000..56dcd0c
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_in.pass.cpp
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char32_t, char, mbstate_t>
+
+// result in(stateT& state, 
+//           const externT* from, const externT* from_end, const externT*& from_next, 
+//           internT* to, internT* to_end, internT*& to_next) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+typedef std::codecvt<char32_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const char from[] = "some text";
+    F::intern_type to[9];
+    const F& f = std::use_facet<F>(l);
+    std::mbstate_t mbs;
+    const char* from_next = 0;
+    F::intern_type* to_next = 0;
+    assert(f.in(mbs, from, from + 9, from_next,
+                     to, to + 9, to_next) == F::ok);
+    assert(from_next - from == 9);
+    assert(to_next - to == 9);
+    for (unsigned i = 0; i < 9; ++i)
+        assert(to[i] == from[i]);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp
new file mode 100644
index 0000000..aa59da9
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_length.pass.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char32_t, char, mbstate_t>
+
+// int length(stateT& state, const externT* from, const externT* from_end, size_t max) const;
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt<char32_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const F& f = std::use_facet<F>(l);
+    std::mbstate_t mbs;
+    const char from[] = "some text";
+    assert(f.length(mbs, from, from+10, 0) == 0);
+    assert(f.length(mbs, from, from+10, 8) == 8);
+    assert(f.length(mbs, from, from+10, 9) == 9);
+    assert(f.length(mbs, from, from+10, 10) == 10);
+    assert(f.length(mbs, from, from+10, 100) == 10);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_max_length.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_max_length.pass.cpp
new file mode 100644
index 0000000..ff5869b
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_max_length.pass.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char32_t, char, mbstate_t>
+
+// int max_length() const throw();
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt<char32_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const F& f = std::use_facet<F>(l);
+    assert(f.max_length() == 4);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp
new file mode 100644
index 0000000..0f6288e
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_out.pass.cpp
@@ -0,0 +1,45 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char32_t, char, mbstate_t>
+
+// result out(stateT& state, 
+//            const internT* from, const internT* from_end, const internT*& from_next, 
+//            externT* to, externT* to_end, externT*& to_next) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+#include <stdio.h>
+
+typedef std::codecvt<char32_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const F& f = std::use_facet<F>(l);
+    {
+        F::intern_type from[9] = {'s', 'o', 'm', 'e', ' ', 't', 'e', 'x', 't'};
+        char to[9] = {0};
+        std::mbstate_t mbs;
+        const F::intern_type* from_next = 0;
+        char* to_next = 0;
+        F::result r = f.out(mbs, from, from + 9, from_next,
+                                 to, to + 9, to_next);
+        assert(r == F::ok);
+        assert(from_next - from == 9);
+        assert(to_next - to == 9);
+        for (unsigned i = 0; i < 9; ++i)
+            assert(to[i] == from[i]);
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp
new file mode 100644
index 0000000..80e3485
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char32_t_unshift.pass.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char32_t, char, mbstate_t>
+
+// result unshift(stateT& state,
+//                externT* to, externT* to_end, externT*& to_next) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+typedef std::codecvt<char32_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    std::vector<char> to(3);
+    const F& f = std::use_facet<F>(l);
+    std::mbstate_t mbs;
+    char* to_next = 0;
+    assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::noconv);
+    assert(to_next == to.data());
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_always_noconv.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_always_noconv.pass.cpp
new file mode 100644
index 0000000..d98d8d4
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_always_noconv.pass.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char, char, mbstate_t>
+
+// bool always_noconv() const throw();
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt<char, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const F& f = std::use_facet<F>(l);
+    assert(f.always_noconv());
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_encoding.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_encoding.pass.cpp
new file mode 100644
index 0000000..32ef730
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_encoding.pass.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char, char, mbstate_t>
+
+// int encoding() const throw();
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt<char, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const F& f = std::use_facet<F>(l);
+    assert(f.encoding() == 1);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_in.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_in.pass.cpp
new file mode 100644
index 0000000..ddcc640
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_in.pass.cpp
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char, char, mbstate_t>
+
+// result in(stateT& state, 
+//           const externT* from, const externT* from_end, const externT*& from_next, 
+//           internT* to, internT* to_end, internT*& to_next) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+typedef std::codecvt<char, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const std::basic_string<F::intern_type> from("some text");
+    std::vector<char> to(from.size());
+    const F& f = std::use_facet<F>(l);
+    std::mbstate_t mbs;
+    const char* from_next = 0;
+    char* to_next = 0;
+    assert(f.in(mbs, from.data(), from.data() + from.size(), from_next,
+                     to.data(), to.data() + to.size(), to_next) == F::noconv);
+    assert(from_next == from.data());
+    assert(to_next == to.data());
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_length.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_length.pass.cpp
new file mode 100644
index 0000000..1e4df5c
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_length.pass.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char, char, mbstate_t>
+
+// int length(stateT& state, const externT* from, const externT* from_end, size_t max) const;
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt<char, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const F& f = std::use_facet<F>(l);
+    std::mbstate_t mbs;
+    const char from[10]= {0};
+    assert(f.length(mbs, from, from+10, 0) == 0);
+    assert(f.length(mbs, from, from+10, 9) == 9);
+    assert(f.length(mbs, from, from+10, 10) == 10);
+    assert(f.length(mbs, from, from+10, 11) == 10);
+    assert(f.length(mbs, from, from+10, 100) == 10);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_max_length.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_max_length.pass.cpp
new file mode 100644
index 0000000..0237953
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_max_length.pass.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char, char, mbstate_t>
+
+// int max_length() const throw();
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt<char, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const F& f = std::use_facet<F>(l);
+    assert(f.max_length() == 1);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_out.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_out.pass.cpp
new file mode 100644
index 0000000..6e91415
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_out.pass.cpp
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char, char, mbstate_t>
+
+// result out(stateT& state, 
+//            const internT* from, const internT* from_end, const internT*& from_next, 
+//            externT* to, externT* to_end, externT*& to_next) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+typedef std::codecvt<char, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const std::basic_string<F::intern_type> from("some text");
+    std::vector<char> to(from.size());
+    const F& f = std::use_facet<F>(l);
+    std::mbstate_t mbs;
+    const char* from_next = 0;
+    char* to_next = 0;
+    assert(f.out(mbs, from.data(), from.data() + from.size(), from_next,
+                      to.data(), to.data() + to.size(), to_next) == F::noconv);
+    assert(from_next == from.data());
+    assert(to_next == to.data());
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_unshift.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_unshift.pass.cpp
new file mode 100644
index 0000000..4f62d9a
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/char_unshift.pass.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char, char, mbstate_t>
+
+// result unshift(stateT& state,
+//                externT* to, externT* to_end, externT*& to_next) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+typedef std::codecvt<char, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    std::vector<char> to(3);
+    const F& f = std::use_facet<F>(l);
+    std::mbstate_t mbs;
+    char* to_next = 0;
+    assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::noconv);
+    assert(to_next == to.data());
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp
new file mode 100644
index 0000000..4de21f5
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/utf_sanity_check.pass.cpp
@@ -0,0 +1,117 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<char32_t, char, mbstate_t>
+// template <> class codecvt<char16_t, char, mbstate_t>
+// template <> class codecvt<char32_t, char16_t, mbstate_t>  // extension
+
+// sanity check
+
+#include <locale>
+#include <cassert>
+
+#include <stdio.h>
+
+int main()
+{
+    typedef std::codecvt<char32_t, char, std::mbstate_t> F32_8;
+    typedef std::codecvt<char16_t, char, std::mbstate_t> F16_8;
+    typedef std::codecvt<char32_t, char16_t, std::mbstate_t> F32_16;
+    std::locale l = std::locale(std::locale::classic(), new F32_16);
+    const F32_8& f32_8 = std::use_facet<F32_8>(l);
+    const F32_16& f32_16 = std::use_facet<F32_16>(l);
+    const F16_8& f16_8 = std::use_facet<F16_8>(l);
+    std::mbstate_t mbs = {0};
+    F32_8::intern_type* c32p;
+    F16_8::intern_type* c16p;
+    F32_8::extern_type* c8p;
+    const F32_8::intern_type* c_c32p;
+    const F16_8::intern_type* c_c16p;
+    const F32_8::extern_type* c_c8p;
+    F32_8::intern_type c32;
+    F16_8::intern_type c16[2];
+    F32_8::extern_type c8[4];
+    for (F32_8::intern_type c32x = 0; c32x < 0x110003; ++c32x)
+    {
+        if (0xD800 <= c32x && c32x < 0xE000 || c32x >= 0x110000)
+        {
+            assert(f32_16.out(mbs, &c32x, &c32x+1, c_c32p, c16+0, c16+2, c16p) == F32_8::error);
+            assert(f32_8.out(mbs, &c32x, &c32x+1, c_c32p, c8, c8+4, c8p) == F32_8::error);
+        }
+        else
+        {
+            assert(f32_16.out(mbs, &c32x, &c32x+1, c_c32p, c16, c16+2, c16p) == F32_8::ok);
+            assert(c_c32p-&c32x == 1);
+            if (c32x < 0x10000)
+                assert(c16p-c16 == 1);
+            else
+                assert(c16p-c16 == 2);
+            c_c16p = c16p;
+            assert(f16_8.out(mbs, c16, c_c16p, c_c16p, c8, c8+4, c8p) == F32_8::ok);
+            if (c32x < 0x10000)
+                assert(c_c16p-c16 == 1);
+            else
+                assert(c_c16p-c16 == 2);
+            if (c32x < 0x80)
+                assert(c8p-c8 == 1);
+            else if (c32x < 0x800)
+                assert(c8p-c8 == 2);
+            else if (c32x < 0x10000)
+                assert(c8p-c8 == 3);
+            else
+                assert(c8p-c8 == 4);
+            c_c8p = c8p;
+            assert(f32_8.in(mbs, c8, c_c8p, c_c8p, &c32, &c32+1, c32p) == F32_8::ok);
+            if (c32x < 0x80)
+                assert(c_c8p-c8 == 1);
+            else if (c32x < 0x800)
+                assert(c_c8p-c8 == 2);
+            else if (c32x < 0x10000)
+                assert(c_c8p-c8 == 3);
+            else
+                assert(c_c8p-c8 == 4);
+            assert(c32p-&c32 == 1);
+            assert(c32 == c32x);
+            assert(f32_8.out(mbs, &c32x, &c32x+1, c_c32p, c8, c8+4, c8p) == F32_8::ok);
+            assert(c_c32p-&c32x == 1);
+            if (c32x < 0x80)
+                assert(c8p-c8 == 1);
+            else if (c32x < 0x800)
+                assert(c8p-c8 == 2);
+            else if (c32x < 0x10000)
+                assert(c8p-c8 == 3);
+            else
+                assert(c8p-c8 == 4);
+            c_c8p = c8p;
+            assert(f16_8.in(mbs, c8, c_c8p, c_c8p, c16, c16+2, c16p) == F32_8::ok);
+            if (c32x < 0x80)
+                assert(c_c8p-c8 == 1);
+            else if (c32x < 0x800)
+                assert(c_c8p-c8 == 2);
+            else if (c32x < 0x10000)
+                assert(c_c8p-c8 == 3);
+            else
+                assert(c_c8p-c8 == 4);
+            if (c32x < 0x10000)
+                assert(c16p-c16 == 1);
+            else
+                assert(c16p-c16 == 2);
+            c_c16p = c16p;
+            assert(f32_16.in(mbs, c16, c_c16p, c_c16p, &c32, &c32+1, c32p) == F32_8::ok);
+            if (c32x < 0x10000)
+                assert(c_c16p-c16 == 1);
+            else
+                assert(c_c16p-c16 == 2);
+            assert(c32p-&c32 == 1);
+            assert(c32 == c32x);
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_always_noconv.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_always_noconv.pass.cpp
new file mode 100644
index 0000000..9953d95
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_always_noconv.pass.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<wchar_t, char, mbstate_t>
+
+// bool always_noconv() const throw();
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt<wchar_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const F& f = std::use_facet<F>(l);
+    assert(!f.always_noconv());
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_encoding.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_encoding.pass.cpp
new file mode 100644
index 0000000..502d676
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_encoding.pass.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<wchar_t, char, mbstate_t>
+
+// int encoding() const throw();
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt<wchar_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const F& f = std::use_facet<F>(l);
+    assert(f.encoding() == 1);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp
new file mode 100644
index 0000000..39ed2b1
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<wchar_t, char, mbstate_t>
+
+// result in(stateT& state, 
+//           const externT* from, const externT* from_end, const externT*& from_next, 
+//           internT* to, internT* to_end, internT*& to_next) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+typedef std::codecvt<wchar_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const std::basic_string<F::extern_type> from("some text");
+    const std::basic_string<F::intern_type> expected(from.begin(), from.end());
+    std::basic_string<F::intern_type> to(from.size(), F::intern_type());
+    const F& f = std::use_facet<F>(l);
+    std::mbstate_t mbs = {0};
+    const F::extern_type* from_next = 0;
+    F::intern_type* to_next = 0;
+    F::result r = f.in(mbs, from.data(), from.data() + from.size(), from_next,
+                            &to[0], &to[0] + to.size(), to_next);
+    assert(r == F::ok);
+    assert(from_next - from.data() == from.size());
+    assert(to_next - to.data() == expected.size());
+    assert(to_next - to.data() == expected.size());
+    assert(to == expected);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_length.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_length.pass.cpp
new file mode 100644
index 0000000..0c19222
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_length.pass.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<wchar_t, char, mbstate_t>
+
+// int length(stateT& state, const externT* from, const externT* from_end, size_t max) const;
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt<wchar_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const F& f = std::use_facet<F>(l);
+    std::mbstate_t mbs = {0};
+    const char* from = "123467890";
+    assert(f.length(mbs, from, from+10, 0) == 0);
+    assert(f.length(mbs, from, from+10, 9) == 9);
+    assert(f.length(mbs, from, from+10, 10) == 10);
+    assert(f.length(mbs, from, from+10, 11) == 10);
+    assert(f.length(mbs, from, from+10, 100) == 10);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_max_length.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_max_length.pass.cpp
new file mode 100644
index 0000000..70f349f
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_max_length.pass.cpp
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<wchar_t, char, mbstate_t>
+
+// int max_length() const throw();
+
+#include <locale>
+#include <cassert>
+
+typedef std::codecvt<wchar_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const F& f = std::use_facet<F>(l);
+    assert(f.max_length() == 1);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp
new file mode 100644
index 0000000..b90b357
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp
@@ -0,0 +1,69 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<wchar_t, char, mbstate_t>
+
+// result out(stateT& state, 
+//            const internT* from, const internT* from_end, const internT*& from_next, 
+//            externT* to, externT* to_end, externT*& to_next) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+typedef std::codecvt<wchar_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    const F& f = std::use_facet<F>(l);
+    {
+        const std::basic_string<F::intern_type> from(L"some text");
+        std::vector<char> to(from.size()+1);
+        std::mbstate_t mbs;
+        const F::intern_type* from_next = 0;
+        char* to_next = 0;
+        F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next,
+                                 to.data(), to.data() + to.size(), to_next);
+        assert(r == F::ok);
+        assert(from_next - from.data() == from.size());
+        assert(to_next - to.data() == from.size());
+        assert(to.data() == std::string("some text"));
+    }
+    {
+        std::basic_string<F::intern_type> from(L"some text");
+        from[4] = '\0';
+        std::vector<char> to(from.size()+1);
+        std::mbstate_t mbs;
+        const F::intern_type* from_next = 0;
+        char* to_next = 0;
+        F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next,
+                                 to.data(), to.data() + to.size(), to_next);
+        assert(r == F::ok);
+        assert(from_next - from.data() == from.size());
+        assert(to_next - to.data() == from.size());
+        assert(to.data() == std::string("some\0text", from.size()));
+    }
+    {
+        std::basic_string<F::intern_type> from(L"some text");
+        std::vector<char> to(from.size()-1);
+        std::mbstate_t mbs;
+        const F::intern_type* from_next = 0;
+        char* to_next = 0;
+        F::result r = f.out(mbs, from.data(), from.data() + from.size(), from_next,
+                                 to.data(), to.data() + to.size()-1, to_next);
+        assert(r == F::partial);
+        assert(from_next - from.data() == to.size()-1);
+        assert(to_next - to.data() == to.size()-1);
+        assert(to.data() == std::string("some te"));
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_unshift.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_unshift.pass.cpp
new file mode 100644
index 0000000..f5bde98
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_unshift.pass.cpp
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class codecvt<wchar_t, char, mbstate_t>
+
+// result unshift(stateT& state,
+//                externT* to, externT* to_end, externT*& to_next) const;
+
+// This is pretty much just an "are you breathing" test
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+typedef std::codecvt<wchar_t, char, std::mbstate_t> F;
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    std::vector<F::extern_type> to(3);
+    const F& f = std::use_facet<F>(l);
+    std::mbstate_t mbs = {0};
+    F::extern_type* to_next = 0;
+    assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::ok);
+    assert(to_next == to.data());
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.virtuals/tested_elsewhere.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.virtuals/tested_elsewhere.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.virtuals/tested_elsewhere.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/types_char.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/types_char.pass.cpp
new file mode 100644
index 0000000..8d56421
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/types_char.pass.cpp
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <>
+// class codecvt<char, char, mbstate_t>
+//     : public locale::facet,
+//       public codecvt_base
+// {
+// public: 
+//     typedef char      intern_type; 
+//     typedef char      extern_type; 
+//     typedef mbstate_t state_type; 
+//     ...
+// };
+
+#include <locale>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::codecvt<char, char, std::mbstate_t> F;
+    static_assert((std::is_base_of<std::locale::facet, F>::value), "");
+    static_assert((std::is_base_of<std::codecvt_base, F>::value), "");
+    static_assert((std::is_same<F::intern_type, char>::value), "");
+    static_assert((std::is_same<F::extern_type, char>::value), "");
+    static_assert((std::is_same<F::state_type, std::mbstate_t>::value), "");
+    std::locale l = std::locale::classic();
+    assert(std::has_facet<F>(l));
+    const F& f = std::use_facet<F>(l);
+    (void)F::id;
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t.pass.cpp
new file mode 100644
index 0000000..ef6eb49
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/types_char16_t.pass.cpp
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <>
+// class codecvt<char16_t, char, mbstate_t>
+//     : public locale::facet,
+//       public codecvt_base
+// {
+// public: 
+//     typedef char16_t  intern_type; 
+//     typedef char      extern_type; 
+//     typedef mbstate_t state_type; 
+//     ...
+// };
+
+#include <locale>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+//#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
+    typedef std::codecvt<char16_t, char, std::mbstate_t> F;
+    static_assert((std::is_base_of<std::locale::facet, F>::value), "");
+    static_assert((std::is_base_of<std::codecvt_base, F>::value), "");
+    static_assert((std::is_same<F::intern_type, char16_t>::value), "");
+    static_assert((std::is_same<F::extern_type, char>::value), "");
+    static_assert((std::is_same<F::state_type, std::mbstate_t>::value), "");
+    std::locale l = std::locale::classic();
+    assert(std::has_facet<F>(l));
+    const F& f = std::use_facet<F>(l);
+    (void)F::id;
+//#endif
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t.pass.cpp
new file mode 100644
index 0000000..b626ca6
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/types_char32_t.pass.cpp
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <>
+// class codecvt<char32_t, char, mbstate_t>
+//     : public locale::facet,
+//       public codecvt_base
+// {
+// public: 
+//     typedef char32_t  intern_type; 
+//     typedef char      extern_type; 
+//     typedef mbstate_t state_type; 
+//     ...
+// };
+
+#include <locale>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+//#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
+    typedef std::codecvt<char32_t, char, std::mbstate_t> F;
+    static_assert((std::is_base_of<std::locale::facet, F>::value), "");
+    static_assert((std::is_base_of<std::codecvt_base, F>::value), "");
+    static_assert((std::is_same<F::intern_type, char32_t>::value), "");
+    static_assert((std::is_same<F::extern_type, char>::value), "");
+    static_assert((std::is_same<F::state_type, std::mbstate_t>::value), "");
+    std::locale l = std::locale::classic();
+    assert(std::has_facet<F>(l));
+    const F& f = std::use_facet<F>(l);
+    (void)F::id;
+//#endif
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp b/test/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp
new file mode 100644
index 0000000..8a70fea
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <>
+// class codecvt<wchar_t, char, mbstate_t>
+//     : public locale::facet,
+//       public codecvt_base
+// {
+// public: 
+//     typedef wchar_t   intern_type; 
+//     typedef char      extern_type; 
+//     typedef mbstate_t state_type; 
+//     ...
+// };
+
+#include <locale>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::codecvt<wchar_t, char, std::mbstate_t> F;
+    static_assert((std::is_base_of<std::locale::facet, F>::value), "");
+    static_assert((std::is_base_of<std::codecvt_base, F>::value), "");
+    static_assert((std::is_same<F::intern_type, wchar_t>::value), "");
+    static_assert((std::is_same<F::extern_type, char>::value), "");
+    static_assert((std::is_same<F::state_type, std::mbstate_t>::value), "");
+    std::locale l = std::locale::classic();
+    assert(std::has_facet<F>(l));
+    const F& f = std::use_facet<F>(l);
+    (void)F::id;
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp
new file mode 100644
index 0000000..7d97a57
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp
@@ -0,0 +1,108 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype_byname;
+
+// bool is(mask m, charT c) const;
+
+#include <locale>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    {
+        std::locale l("en_US");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+    
+            assert(f.is(F::space, L' '));
+            assert(!f.is(F::space, L'A'));
+    
+            assert(f.is(F::print, L' '));
+            assert(!f.is(F::print, L'\x07'));
+    
+            assert(f.is(F::cntrl, L'\x07'));
+            assert(!f.is(F::cntrl, L' '));
+    
+            assert(f.is(F::upper, L'A'));
+            assert(!f.is(F::upper, L'a'));
+    
+            assert(f.is(F::lower, L'a'));
+            assert(!f.is(F::lower, L'A'));
+    
+            assert(f.is(F::alpha, L'a'));
+            assert(!f.is(F::alpha, L'1'));
+    
+            assert(f.is(F::digit, L'1'));
+            assert(!f.is(F::digit, L'a'));
+    
+            assert(f.is(F::punct, L'.'));
+            assert(!f.is(F::punct, L'a'));
+    
+            assert(f.is(F::xdigit, L'a'));
+            assert(!f.is(F::xdigit, L'g'));
+    
+            assert(f.is(F::alnum, L'a'));
+            assert(!f.is(F::alnum, L'.'));
+    
+            assert(f.is(F::graph, L'.'));
+            assert(!f.is(F::graph,  L'\x07'));
+
+            assert(f.is(F::alpha, L'\x00DA'));
+            assert(f.is(F::upper, L'\x00DA'));
+        }
+    }
+    {
+        std::locale l("C");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+    
+            assert(f.is(F::space, L' '));
+            assert(!f.is(F::space, L'A'));
+    
+            assert(f.is(F::print, L' '));
+            assert(!f.is(F::print, L'\x07'));
+    
+            assert(f.is(F::cntrl, L'\x07'));
+            assert(!f.is(F::cntrl, L' '));
+    
+            assert(f.is(F::upper, L'A'));
+            assert(!f.is(F::upper, L'a'));
+    
+            assert(f.is(F::lower, L'a'));
+            assert(!f.is(F::lower, L'A'));
+    
+            assert(f.is(F::alpha, L'a'));
+            assert(!f.is(F::alpha, L'1'));
+    
+            assert(f.is(F::digit, L'1'));
+            assert(!f.is(F::digit, L'a'));
+    
+            assert(f.is(F::punct, L'.'));
+            assert(!f.is(F::punct, L'a'));
+    
+            assert(f.is(F::xdigit, L'a'));
+            assert(!f.is(F::xdigit, L'g'));
+    
+            assert(f.is(F::alnum, L'a'));
+            assert(!f.is(F::alnum, L'.'));
+    
+            assert(f.is(F::graph, L'.'));
+            assert(!f.is(F::graph,  L'\x07'));
+
+            assert(!f.is(F::alpha, L'\x00DA'));
+            assert(!f.is(F::upper, L'\x00DA'));
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp
new file mode 100644
index 0000000..5f0f7b6
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp
@@ -0,0 +1,243 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype_byname;
+
+// const charT* do_is(const charT* low, const charT* high, mask* vec) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+#include <stdio.h>
+
+int main()
+{
+    {
+        std::locale l("en_US");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+            const std::wstring in(L"\x00DA A\x07.a1");
+            std::vector<F::mask> m(in.size());
+            const wchar_t* h = f.is(in.data(), in.data() + in.size(), m.data());
+            assert(h == in.data() + in.size());
+    
+            // L'\x00DA'
+            assert(!(m[0] & F::space));
+            assert( (m[0] & F::print));
+            assert(!(m[0] & F::cntrl));
+            assert( (m[0] & F::upper));
+            assert(!(m[0] & F::lower));
+            assert( (m[0] & F::alpha));
+            assert(!(m[0] & F::digit));
+            assert(!(m[0] & F::punct));
+            assert(!(m[0] & F::xdigit));
+            assert(!(m[0] & F::blank));
+            assert( (m[0] & F::alnum));
+            assert( (m[0] & F::graph));
+    
+            // L' '
+            assert( (m[1] & F::space));
+            assert( (m[1] & F::print));
+            assert(!(m[1] & F::cntrl));
+            assert(!(m[1] & F::upper));
+            assert(!(m[1] & F::lower));
+            assert(!(m[1] & F::alpha));
+            assert(!(m[1] & F::digit));
+            assert(!(m[1] & F::punct));
+            assert(!(m[1] & F::xdigit));
+            assert( (m[1] & F::blank));
+            assert(!(m[1] & F::alnum));
+            assert(!(m[1] & F::graph));
+    
+            // L'A'
+            assert(!(m[2] & F::space));
+            assert( (m[2] & F::print));
+            assert(!(m[2] & F::cntrl));
+            assert( (m[2] & F::upper));
+            assert(!(m[2] & F::lower));
+            assert( (m[2] & F::alpha));
+            assert(!(m[2] & F::digit));
+            assert(!(m[2] & F::punct));
+            assert( (m[2] & F::xdigit));
+            assert(!(m[2] & F::blank));
+            assert( (m[2] & F::alnum));
+            assert( (m[2] & F::graph));
+    
+            // L'\x07'
+            assert(!(m[3] & F::space));
+            assert(!(m[3] & F::print));
+            assert( (m[3] & F::cntrl));
+            assert(!(m[3] & F::upper));
+            assert(!(m[3] & F::lower));
+            assert(!(m[3] & F::alpha));
+            assert(!(m[3] & F::digit));
+            assert(!(m[3] & F::punct));
+            assert(!(m[3] & F::xdigit));
+            assert(!(m[3] & F::blank));
+            assert(!(m[3] & F::alnum));
+            assert(!(m[3] & F::graph));
+    
+            // L'.'
+            assert(!(m[4] & F::space));
+            assert( (m[4] & F::print));
+            assert(!(m[4] & F::cntrl));
+            assert(!(m[4] & F::upper));
+            assert(!(m[4] & F::lower));
+            assert(!(m[4] & F::alpha));
+            assert(!(m[4] & F::digit));
+            assert( (m[4] & F::punct));
+            assert(!(m[4] & F::xdigit));
+            assert(!(m[4] & F::blank));
+            assert(!(m[4] & F::alnum));
+            assert( (m[4] & F::graph));
+    
+            // L'a'
+            assert(!(m[5] & F::space));
+            assert( (m[5] & F::print));
+            assert(!(m[5] & F::cntrl));
+            assert(!(m[5] & F::upper));
+            assert( (m[5] & F::lower));
+            assert( (m[5] & F::alpha));
+            assert(!(m[5] & F::digit));
+            assert(!(m[5] & F::punct));
+            assert( (m[5] & F::xdigit));
+            assert(!(m[5] & F::blank));
+            assert( (m[5] & F::alnum));
+            assert( (m[5] & F::graph));
+    
+            // L'1'
+            assert(!(m[6] & F::space));
+            assert( (m[6] & F::print));
+            assert(!(m[6] & F::cntrl));
+            assert(!(m[6] & F::upper));
+            assert(!(m[6] & F::lower));
+            assert(!(m[6] & F::alpha));
+            assert( (m[6] & F::digit));
+            assert(!(m[6] & F::punct));
+            assert( (m[6] & F::xdigit));
+            assert(!(m[6] & F::blank));
+            assert( (m[6] & F::alnum));
+            assert( (m[6] & F::graph));
+        }
+    }
+    {
+        std::locale l("C");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+            const std::wstring in(L"\x00DA A\x07.a1");
+            std::vector<F::mask> m(in.size());
+            const wchar_t* h = f.is(in.data(), in.data() + in.size(), m.data());
+            assert(h == in.data() + in.size());
+    
+            // L'\x00DA'
+            assert(!(m[0] & F::space));
+            assert(!(m[0] & F::print));
+            assert(!(m[0] & F::cntrl));
+            assert(!(m[0] & F::upper));
+            assert(!(m[0] & F::lower));
+            assert(!(m[0] & F::alpha));
+            assert(!(m[0] & F::digit));
+            assert(!(m[0] & F::punct));
+            assert(!(m[0] & F::xdigit));
+            assert(!(m[0] & F::blank));
+            assert(!(m[0] & F::alnum));
+            assert(!(m[0] & F::graph));
+    
+            // L' '
+            assert( (m[1] & F::space));
+            assert( (m[1] & F::print));
+            assert(!(m[1] & F::cntrl));
+            assert(!(m[1] & F::upper));
+            assert(!(m[1] & F::lower));
+            assert(!(m[1] & F::alpha));
+            assert(!(m[1] & F::digit));
+            assert(!(m[1] & F::punct));
+            assert(!(m[1] & F::xdigit));
+            assert( (m[1] & F::blank));
+            assert(!(m[1] & F::alnum));
+            assert(!(m[1] & F::graph));
+    
+            // L'A'
+            assert(!(m[2] & F::space));
+            assert( (m[2] & F::print));
+            assert(!(m[2] & F::cntrl));
+            assert( (m[2] & F::upper));
+            assert(!(m[2] & F::lower));
+            assert( (m[2] & F::alpha));
+            assert(!(m[2] & F::digit));
+            assert(!(m[2] & F::punct));
+            assert( (m[2] & F::xdigit));
+            assert(!(m[2] & F::blank));
+            assert( (m[2] & F::alnum));
+            assert( (m[2] & F::graph));
+    
+            // L'\x07'
+            assert(!(m[3] & F::space));
+            assert(!(m[3] & F::print));
+            assert( (m[3] & F::cntrl));
+            assert(!(m[3] & F::upper));
+            assert(!(m[3] & F::lower));
+            assert(!(m[3] & F::alpha));
+            assert(!(m[3] & F::digit));
+            assert(!(m[3] & F::punct));
+            assert(!(m[3] & F::xdigit));
+            assert(!(m[3] & F::blank));
+            assert(!(m[3] & F::alnum));
+            assert(!(m[3] & F::graph));
+    
+            // L'.'
+            assert(!(m[4] & F::space));
+            assert( (m[4] & F::print));
+            assert(!(m[4] & F::cntrl));
+            assert(!(m[4] & F::upper));
+            assert(!(m[4] & F::lower));
+            assert(!(m[4] & F::alpha));
+            assert(!(m[4] & F::digit));
+            assert( (m[4] & F::punct));
+            assert(!(m[4] & F::xdigit));
+            assert(!(m[4] & F::blank));
+            assert(!(m[4] & F::alnum));
+            assert( (m[4] & F::graph));
+    
+            // L'a'
+            assert(!(m[5] & F::space));
+            assert( (m[5] & F::print));
+            assert(!(m[5] & F::cntrl));
+            assert(!(m[5] & F::upper));
+            assert( (m[5] & F::lower));
+            assert( (m[5] & F::alpha));
+            assert(!(m[5] & F::digit));
+            assert(!(m[5] & F::punct));
+            assert( (m[5] & F::xdigit));
+            assert(!(m[5] & F::blank));
+            assert( (m[5] & F::alnum));
+            assert( (m[5] & F::graph));
+    
+            // L'1'
+            assert(!(m[6] & F::space));
+            assert( (m[6] & F::print));
+            assert(!(m[6] & F::cntrl));
+            assert(!(m[6] & F::upper));
+            assert(!(m[6] & F::lower));
+            assert(!(m[6] & F::alpha));
+            assert( (m[6] & F::digit));
+            assert(!(m[6] & F::punct));
+            assert( (m[6] & F::xdigit));
+            assert(!(m[6] & F::blank));
+            assert( (m[6] & F::alnum));
+            assert( (m[6] & F::graph));
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp
new file mode 100644
index 0000000..048c280
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype_byname;
+
+// char narrow(charT c, char dfault) const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    {
+        std::locale l(std::string("fr_CA.ISO8859-1"));
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+    
+            assert(f.narrow(L' ', '*') == ' ');
+            assert(f.narrow(L'A', '*') == 'A');
+            assert(f.narrow(L'\x07', '*') == '\x07');
+            assert(f.narrow(L'.', '*') == '.');
+            assert(f.narrow(L'a', '*') == 'a');
+            assert(f.narrow(L'1', '*') == '1');
+            assert(f.narrow(L'\xDA', '*') == '\xDA');
+        }
+    }
+    {
+        std::locale l("en_US");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+    
+            assert(f.narrow(L' ', '*') == ' ');
+            assert(f.narrow(L'A', '*') == 'A');
+            assert(f.narrow(L'\x07', '*') == '\x07');
+            assert(f.narrow(L'.', '*') == '.');
+            assert(f.narrow(L'a', '*') == 'a');
+            assert(f.narrow(L'1', '*') == '1');
+            assert(f.narrow(L'\xDA', '*') == '*');
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp
new file mode 100644
index 0000000..03353ff
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp
@@ -0,0 +1,59 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype_byname;
+
+// const charT* narrow(const charT* low, const charT*, char dfault, char* to) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+int main()
+{
+    {
+        std::locale l("fr_CA.ISO8859-1");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+            std::wstring in(L" A\x07.a1\xDA");
+            std::vector<char> v(in.size());
+    
+            assert(f.narrow(&in[0], in.data() + in.size(), '*', v.data()) == in.data() + in.size());
+            assert(v[0] == ' ');
+            assert(v[1] == 'A');
+            assert(v[2] == '\x07');
+            assert(v[3] == '.');
+            assert(v[4] == 'a');
+            assert(v[5] == '1');
+            assert(v[6] == '\xDA');
+        }
+    }
+    {
+        std::locale l("en_US");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+            std::wstring in(L" A\x07.a1\xDA");
+            std::vector<char> v(in.size());
+    
+            assert(f.narrow(&in[0], in.data() + in.size(), '*', v.data()) == in.data() + in.size());
+            assert(v[0] == ' ');
+            assert(v[1] == 'A');
+            assert(v[2] == '\x07');
+            assert(v[3] == '.');
+            assert(v[4] == 'a');
+            assert(v[5] == '1');
+            assert(v[6] == '*');
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp
new file mode 100644
index 0000000..11a80cd
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp
@@ -0,0 +1,67 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype_byname;
+
+// const charT* scan_is(mask m, const charT* low, const charT* high) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+#include <stdio.h>
+
+int main()
+{
+    {
+        std::locale l("en_US");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+            const std::wstring in(L"\x00DA A\x07.a1");
+            std::vector<F::mask> m(in.size());
+            assert(f.scan_is(F::space, in.data(), in.data() + in.size()) - in.data() == 1);
+            assert(f.scan_is(F::print, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_is(F::cntrl, in.data(), in.data() + in.size()) - in.data() == 3);
+            assert(f.scan_is(F::upper, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_is(F::lower, in.data(), in.data() + in.size()) - in.data() == 5);
+            assert(f.scan_is(F::alpha, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_is(F::digit, in.data(), in.data() + in.size()) - in.data() == 6);
+            assert(f.scan_is(F::punct, in.data(), in.data() + in.size()) - in.data() == 4);
+            assert(f.scan_is(F::xdigit, in.data(), in.data() + in.size()) - in.data() == 2);
+            assert(f.scan_is(F::blank, in.data(), in.data() + in.size()) - in.data() == 1);
+            assert(f.scan_is(F::alnum, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_is(F::graph, in.data(), in.data() + in.size()) - in.data() == 0);
+        }
+    }
+    {
+        std::locale l("C");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+            const std::wstring in(L"\x00DA A\x07.a1");
+            std::vector<F::mask> m(in.size());
+            assert(f.scan_is(F::space, in.data(), in.data() + in.size()) - in.data() == 1);
+            assert(f.scan_is(F::print, in.data(), in.data() + in.size()) - in.data() == 1);
+            assert(f.scan_is(F::cntrl, in.data(), in.data() + in.size()) - in.data() == 3);
+            assert(f.scan_is(F::upper, in.data(), in.data() + in.size()) - in.data() == 2);
+            assert(f.scan_is(F::lower, in.data(), in.data() + in.size()) - in.data() == 5);
+            assert(f.scan_is(F::alpha, in.data(), in.data() + in.size()) - in.data() == 2);
+            assert(f.scan_is(F::digit, in.data(), in.data() + in.size()) - in.data() == 6);
+            assert(f.scan_is(F::punct, in.data(), in.data() + in.size()) - in.data() == 4);
+            assert(f.scan_is(F::xdigit, in.data(), in.data() + in.size()) - in.data() == 2);
+            assert(f.scan_is(F::blank, in.data(), in.data() + in.size()) - in.data() == 1);
+            assert(f.scan_is(F::alnum, in.data(), in.data() + in.size()) - in.data() == 2);
+            assert(f.scan_is(F::graph, in.data(), in.data() + in.size()) - in.data() == 2);
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp
new file mode 100644
index 0000000..b7e8440
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp
@@ -0,0 +1,67 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype_byname;
+
+// const charT* scan_not(mask m, const charT* low, const charT* high) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+#include <stdio.h>
+
+int main()
+{
+    {
+        std::locale l("en_US");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+            const std::wstring in(L"\x00DA A\x07.a1");
+            std::vector<F::mask> m(in.size());
+            assert(f.scan_not(F::space, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_not(F::print, in.data(), in.data() + in.size()) - in.data() == 3);
+            assert(f.scan_not(F::cntrl, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_not(F::upper, in.data(), in.data() + in.size()) - in.data() == 1);
+            assert(f.scan_not(F::lower, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_not(F::alpha, in.data(), in.data() + in.size()) - in.data() == 1);
+            assert(f.scan_not(F::digit, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_not(F::punct, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_not(F::xdigit, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_not(F::blank, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_not(F::alnum, in.data(), in.data() + in.size()) - in.data() == 1);
+            assert(f.scan_not(F::graph, in.data(), in.data() + in.size()) - in.data() == 1);
+        }
+    }
+    {
+        std::locale l("C");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+            const std::wstring in(L"\x00DA A\x07.a1");
+            std::vector<F::mask> m(in.size());
+            assert(f.scan_not(F::space, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_not(F::print, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_not(F::cntrl, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_not(F::upper, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_not(F::lower, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_not(F::alpha, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_not(F::digit, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_not(F::punct, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_not(F::xdigit, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_not(F::blank, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_not(F::alnum, in.data(), in.data() + in.size()) - in.data() == 0);
+            assert(f.scan_not(F::graph, in.data(), in.data() + in.size()) - in.data() == 0);
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp
new file mode 100644
index 0000000..7e890ff
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp
@@ -0,0 +1,85 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype_byname;
+
+// charT tolower(charT) const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    {
+        std::locale l("en_US");
+        {
+            typedef std::ctype<char> F;
+            const F& f = std::use_facet<F>(l);
+    
+            assert(f.tolower(' ') == ' ');
+            assert(f.tolower('A') == 'a');
+            assert(f.tolower('\x07') == '\x07');
+            assert(f.tolower('.') == '.');
+            assert(f.tolower('a') == 'a');
+            assert(f.tolower('1') == '1');
+            assert(f.tolower('\xDA') == '\xDA');
+            assert(f.tolower('\xFA') == '\xFA');
+        }
+    }
+    {
+        std::locale l("C");
+        {
+            typedef std::ctype<char> F;
+            const F& f = std::use_facet<F>(l);
+    
+            assert(f.tolower(' ') == ' ');
+            assert(f.tolower('A') == 'a');
+            assert(f.tolower('\x07') == '\x07');
+            assert(f.tolower('.') == '.');
+            assert(f.tolower('a') == 'a');
+            assert(f.tolower('1') == '1');
+            assert(f.tolower('\xDA') == '\xDA');
+            assert(f.tolower('\xFA') == '\xFA');
+        }
+    }
+    {
+        std::locale l("en_US");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+    
+            assert(f.tolower(L' ') == L' ');
+            assert(f.tolower(L'A') == L'a');
+            assert(f.tolower(L'\x07') == L'\x07');
+            assert(f.tolower(L'.') == L'.');
+            assert(f.tolower(L'a') == L'a');
+            assert(f.tolower(L'1') == L'1');
+            assert(f.tolower(L'\xDA') == L'\xFA');
+            assert(f.tolower(L'\xFA') == L'\xFA');
+        }
+    }
+    {
+        std::locale l("C");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+    
+            assert(f.tolower(L' ') == L' ');
+            assert(f.tolower(L'A') == L'a');
+            assert(f.tolower(L'\x07') == L'\x07');
+            assert(f.tolower(L'.') == L'.');
+            assert(f.tolower(L'a') == L'a');
+            assert(f.tolower(L'1') == L'1');
+            assert(f.tolower(L'\xDA') == L'\xDA');
+            assert(f.tolower(L'\xFA') == L'\xFA');
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp
new file mode 100644
index 0000000..940fe4c
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp
@@ -0,0 +1,90 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype_byname;
+
+// const charT* tolower(charT* low, const charT* high) const;
+
+#include <locale>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    {
+        std::locale l("en_US");
+        {
+            typedef std::ctype<char> F;
+            const F& f = std::use_facet<F>(l);
+            std::string in("\xDA A\x07.a1");
+    
+            assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size());
+            assert(in[0] == '\xDA');
+            assert(in[1] == ' ');
+            assert(in[2] == 'a');
+            assert(in[3] == '\x07');
+            assert(in[4] == '.');
+            assert(in[5] == 'a');
+            assert(in[6] == '1');
+        }
+    }
+    {
+        std::locale l("C");
+        {
+            typedef std::ctype<char> F;
+            const F& f = std::use_facet<F>(l);
+            std::string in("\xDA A\x07.a1");
+    
+            assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size());
+            assert(in[0] == '\xDA');
+            assert(in[1] == ' ');
+            assert(in[2] == 'a');
+            assert(in[3] == '\x07');
+            assert(in[4] == '.');
+            assert(in[5] == 'a');
+            assert(in[6] == '1');
+        }
+    }
+    {
+        std::locale l("en_US");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+            std::wstring in(L"\xDA A\x07.a1");
+    
+            assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size());
+            assert(in[0] == L'\xFA');
+            assert(in[1] == L' ');
+            assert(in[2] == L'a');
+            assert(in[3] == L'\x07');
+            assert(in[4] == L'.');
+            assert(in[5] == L'a');
+            assert(in[6] == L'1');
+        }
+    }
+    {
+        std::locale l("C");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+            std::wstring in(L"\xDA A\x07.a1");
+    
+            assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size());
+            assert(in[0] == L'\xDA');
+            assert(in[1] == L' ');
+            assert(in[2] == L'a');
+            assert(in[3] == L'\x07');
+            assert(in[4] == L'.');
+            assert(in[5] == L'a');
+            assert(in[6] == L'1');
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp
new file mode 100644
index 0000000..42fba69
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp
@@ -0,0 +1,85 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype_byname;
+
+// charT toupper(charT) const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    {
+        std::locale l("en_US");
+        {
+            typedef std::ctype<char> F;
+            const F& f = std::use_facet<F>(l);
+    
+            assert(f.toupper(' ') == ' ');
+            assert(f.toupper('A') == 'A');
+            assert(f.toupper('\x07') == '\x07');
+            assert(f.toupper('.') == '.');
+            assert(f.toupper('a') == 'A');
+            assert(f.toupper('1') == '1');
+            assert(f.toupper('\xDA') == '\xDA');
+            assert(f.toupper('\xFA') == '\xFA');
+        }
+    }
+    {
+        std::locale l("C");
+        {
+            typedef std::ctype<char> F;
+            const F& f = std::use_facet<F>(l);
+    
+            assert(f.toupper(' ') == ' ');
+            assert(f.toupper('A') == 'A');
+            assert(f.toupper('\x07') == '\x07');
+            assert(f.toupper('.') == '.');
+            assert(f.toupper('a') == 'A');
+            assert(f.toupper('1') == '1');
+            assert(f.toupper('\xDA') == '\xDA');
+            assert(f.toupper('\xFA') == '\xFA');
+        }
+    }
+    {
+        std::locale l("en_US");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+    
+            assert(f.toupper(L' ') == L' ');
+            assert(f.toupper(L'A') == L'A');
+            assert(f.toupper(L'\x07') == L'\x07');
+            assert(f.toupper(L'.') == L'.');
+            assert(f.toupper(L'a') == L'A');
+            assert(f.toupper(L'1') == L'1');
+            assert(f.toupper(L'\xDA') == L'\xDA');
+            assert(f.toupper(L'\xFA') == L'\xDA');
+        }
+    }
+    {
+        std::locale l("C");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+    
+            assert(f.toupper(L' ') == L' ');
+            assert(f.toupper(L'A') == L'A');
+            assert(f.toupper(L'\x07') == L'\x07');
+            assert(f.toupper(L'.') == L'.');
+            assert(f.toupper(L'a') == L'A');
+            assert(f.toupper(L'1') == L'1');
+            assert(f.toupper(L'\xDA') == L'\xDA');
+            assert(f.toupper(L'\xFA') == L'\xFA');
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp
new file mode 100644
index 0000000..b782c04
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp
@@ -0,0 +1,90 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype_byname;
+
+// const charT* toupper(charT* low, const charT* high) const;
+
+#include <locale>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    {
+        std::locale l("en_US");
+        {
+            typedef std::ctype<char> F;
+            const F& f = std::use_facet<F>(l);
+            std::string in("\xFA A\x07.a1");
+    
+            assert(f.toupper(&in[0], in.data() + in.size()) == in.data() + in.size());
+            assert(in[0] == '\xFA');
+            assert(in[1] == ' ');
+            assert(in[2] == 'A');
+            assert(in[3] == '\x07');
+            assert(in[4] == '.');
+            assert(in[5] == 'A');
+            assert(in[6] == '1');
+        }
+    }
+    {
+        std::locale l("C");
+        {
+            typedef std::ctype<char> F;
+            const F& f = std::use_facet<F>(l);
+            std::string in("\xFA A\x07.a1");
+    
+            assert(f.toupper(&in[0], in.data() + in.size()) == in.data() + in.size());
+            assert(in[0] == '\xFA');
+            assert(in[1] == ' ');
+            assert(in[2] == 'A');
+            assert(in[3] == '\x07');
+            assert(in[4] == '.');
+            assert(in[5] == 'A');
+            assert(in[6] == '1');
+        }
+    }
+    {
+        std::locale l("en_US");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+            std::wstring in(L"\xFA A\x07.a1");
+    
+            assert(f.toupper(&in[0], in.data() + in.size()) == in.data() + in.size());
+            assert(in[0] == L'\xDA');
+            assert(in[1] == L' ');
+            assert(in[2] == L'A');
+            assert(in[3] == L'\x07');
+            assert(in[4] == L'.');
+            assert(in[5] == L'A');
+            assert(in[6] == L'1');
+        }
+    }
+    {
+        std::locale l("C");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+            std::wstring in(L"\xFA A\x07.a1");
+    
+            assert(f.toupper(&in[0], in.data() + in.size()) == in.data() + in.size());
+            assert(in[0] == L'\xFA');
+            assert(in[1] == L' ');
+            assert(in[2] == L'A');
+            assert(in[3] == L'\x07');
+            assert(in[4] == L'.');
+            assert(in[5] == L'A');
+            assert(in[6] == L'1');
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp
new file mode 100644
index 0000000..15fa797
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp
@@ -0,0 +1,69 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class CharT>
+// class ctype_byname
+//     : public ctype<CharT>
+// {
+// public: 
+//     explicit ctype_byname(const char*, size_t = 0); 
+//     explicit ctype_byname(const string&, size_t = 0); 
+// 
+// protected: 
+//     ~ctype_byname(); 
+// };
+
+#include <locale>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    {
+        std::locale l("en_US");
+        {
+            assert(std::has_facet<std::ctype_byname<char> >(l));
+            assert(&std::use_facet<std::ctype<char> >(l)
+                == &std::use_facet<std::ctype_byname<char> >(l));
+        }
+        {
+            assert(std::has_facet<std::ctype_byname<wchar_t> >(l));
+            assert(&std::use_facet<std::ctype<wchar_t> >(l)
+                == &std::use_facet<std::ctype_byname<wchar_t> >(l));
+        }
+    }
+    {
+        std::locale l("");
+        {
+            assert(std::has_facet<std::ctype_byname<char> >(l));
+            assert(&std::use_facet<std::ctype<char> >(l)
+                == &std::use_facet<std::ctype_byname<char> >(l));
+        }
+        {
+            assert(std::has_facet<std::ctype_byname<wchar_t> >(l));
+            assert(&std::use_facet<std::ctype<wchar_t> >(l)
+                == &std::use_facet<std::ctype_byname<wchar_t> >(l));
+        }
+    }
+    {
+        std::locale l("C");
+        {
+            assert(std::has_facet<std::ctype_byname<char> >(l));
+            assert(&std::use_facet<std::ctype<char> >(l)
+                == &std::use_facet<std::ctype_byname<char> >(l));
+        }
+        {
+            assert(std::has_facet<std::ctype_byname<wchar_t> >(l));
+            assert(&std::use_facet<std::ctype<wchar_t> >(l)
+                == &std::use_facet<std::ctype_byname<wchar_t> >(l));
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
new file mode 100644
index 0000000..1417d03
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
@@ -0,0 +1,54 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype_byname;
+
+// charT widen(char c) const;
+
+// I doubt this test is portable
+
+#include <locale>
+#include <cassert>
+#include <limits.h>
+
+int main()
+{
+    {
+        std::locale l("en_US");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+    
+            assert(f.widen(' ') == L' ');
+            assert(f.widen('A') == L'A');
+            assert(f.widen('\x07') == L'\x07');
+            assert(f.widen('.') == L'.');
+            assert(f.widen('a') == L'a');
+            assert(f.widen('1') == L'1');
+            assert(f.widen(char(-5)) == wchar_t(-1));
+        }
+    }
+    {
+        std::locale l("C");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+    
+            assert(f.widen(' ') == L' ');
+            assert(f.widen('A') == L'A');
+            assert(f.widen('\x07') == L'\x07');
+            assert(f.widen('.') == L'.');
+            assert(f.widen('a') == L'a');
+            assert(f.widen('1') == L'1');
+            assert(f.widen(char(-5)) == wchar_t(251));
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp
new file mode 100644
index 0000000..1d5312f
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp
@@ -0,0 +1,61 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype_byname;
+
+// const char* widen(const char* low, const char* high, charT* to) const;
+
+// I doubt this test is portable
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+int main()
+{
+    {
+        std::locale l("en_US");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+            std::string in(" A\x07.a1\x85");
+            std::vector<wchar_t> v(in.size());
+    
+            assert(f.widen(&in[0], in.data() + in.size(), v.data()) == in.data() + in.size());
+            assert(v[0] == L' ');
+            assert(v[1] == L'A');
+            assert(v[2] == L'\x07');
+            assert(v[3] == L'.');
+            assert(v[4] == L'a');
+            assert(v[5] == L'1');
+            assert(v[6] == wchar_t(-1));
+        }
+    }
+    {
+        std::locale l("C");
+        {
+            typedef std::ctype<wchar_t> F;
+            const F& f = std::use_facet<F>(l);
+            std::string in(" A\x07.a1\x85");
+            std::vector<wchar_t> v(in.size());
+    
+            assert(f.widen(&in[0], in.data() + in.size(), v.data()) == in.data() + in.size());
+            assert(v[0] == L' ');
+            assert(v[1] == L'A');
+            assert(v[2] == L'\x07');
+            assert(v[3] == L'.');
+            assert(v[4] == L'a');
+            assert(v[5] == L'1');
+            assert(v[6] == wchar_t(133));
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype/ctor.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype/ctor.pass.cpp
new file mode 100644
index 0000000..935025f
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype/ctor.pass.cpp
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype;
+
+// explicit ctype(size_t refs = 0);
+
+#include <locale>
+#include <cassert>
+
+template <class C>
+class my_facet
+    : public std::ctype<C>
+{
+public:
+    static int count;
+
+    explicit my_facet(std::size_t refs = 0)
+        : std::ctype<C>(refs) {++count;}
+
+    ~my_facet() {--count;}
+};
+
+template <class C> int my_facet<C>::count = 0;
+
+int main()
+{
+    {
+        std::locale l(std::locale::classic(), new my_facet<wchar_t>);
+        assert(my_facet<wchar_t>::count == 1);
+    }
+    assert(my_facet<wchar_t>::count == 0);
+    {
+        my_facet<wchar_t> f(1);
+        assert(my_facet<wchar_t>::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet<wchar_t>::count == 1);
+        }
+        assert(my_facet<wchar_t>::count == 1);
+    }
+    assert(my_facet<wchar_t>::count == 0);
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_1.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_1.pass.cpp
new file mode 100644
index 0000000..07c9e87
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_1.pass.cpp
@@ -0,0 +1,59 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype;
+
+// bool is(mask m, charT c) const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<wchar_t> F;
+        const F& f = std::use_facet<F>(l);
+
+        assert(f.is(F::space, L' '));
+        assert(!f.is(F::space, L'A'));
+
+        assert(f.is(F::print, L' '));
+        assert(!f.is(F::print, L'\x07'));
+
+        assert(f.is(F::cntrl, L'\x07'));
+        assert(!f.is(F::cntrl, L' '));
+
+        assert(f.is(F::upper, L'A'));
+        assert(!f.is(F::upper, L'a'));
+
+        assert(f.is(F::lower, L'a'));
+        assert(!f.is(F::lower, L'A'));
+
+        assert(f.is(F::alpha, L'a'));
+        assert(!f.is(F::alpha, L'1'));
+
+        assert(f.is(F::digit, L'1'));
+        assert(!f.is(F::digit, L'a'));
+
+        assert(f.is(F::punct, L'.'));
+        assert(!f.is(F::punct, L'a'));
+
+        assert(f.is(F::xdigit, L'a'));
+        assert(!f.is(F::xdigit, L'g'));
+
+        assert(f.is(F::alnum, L'a'));
+        assert(!f.is(F::alnum, L'.'));
+
+        assert(f.is(F::graph, L'.'));
+        assert(!f.is(F::graph,  L'\x07'));
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_many.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_many.pass.cpp
new file mode 100644
index 0000000..f1ff948
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_many.pass.cpp
@@ -0,0 +1,118 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype;
+
+// const charT* do_is(const charT* low, const charT* high, mask* vec) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+#include <stdio.h>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<wchar_t> F;
+        const F& f = std::use_facet<F>(l);
+        const std::wstring in(L" A\x07.a1");
+        std::vector<F::mask> m(in.size());
+        const wchar_t* h = f.is(in.data(), in.data() + in.size(), m.data());
+        assert(h == in.data() + in.size());
+
+        // L' '
+        assert( (m[0] & F::space));
+        assert( (m[0] & F::print));
+        assert(!(m[0] & F::cntrl));
+        assert(!(m[0] & F::upper));
+        assert(!(m[0] & F::lower));
+        assert(!(m[0] & F::alpha));
+        assert(!(m[0] & F::digit));
+        assert(!(m[0] & F::punct));
+        assert(!(m[0] & F::xdigit));
+        assert( (m[0] & F::blank));
+        assert(!(m[0] & F::alnum));
+        assert(!(m[0] & F::graph));
+
+        // L'A'
+        assert(!(m[1] & F::space));
+        assert( (m[1] & F::print));
+        assert(!(m[1] & F::cntrl));
+        assert( (m[1] & F::upper));
+        assert(!(m[1] & F::lower));
+        assert( (m[1] & F::alpha));
+        assert(!(m[1] & F::digit));
+        assert(!(m[1] & F::punct));
+        assert( (m[1] & F::xdigit));
+        assert(!(m[1] & F::blank));
+        assert( (m[1] & F::alnum));
+        assert( (m[1] & F::graph));
+
+        // L'\x07'
+        assert(!(m[2] & F::space));
+        assert(!(m[2] & F::print));
+        assert( (m[2] & F::cntrl));
+        assert(!(m[2] & F::upper));
+        assert(!(m[2] & F::lower));
+        assert(!(m[2] & F::alpha));
+        assert(!(m[2] & F::digit));
+        assert(!(m[2] & F::punct));
+        assert(!(m[2] & F::xdigit));
+        assert(!(m[2] & F::blank));
+        assert(!(m[2] & F::alnum));
+        assert(!(m[2] & F::graph));
+
+        // L'.'
+        assert(!(m[3] & F::space));
+        assert( (m[3] & F::print));
+        assert(!(m[3] & F::cntrl));
+        assert(!(m[3] & F::upper));
+        assert(!(m[3] & F::lower));
+        assert(!(m[3] & F::alpha));
+        assert(!(m[3] & F::digit));
+        assert( (m[3] & F::punct));
+        assert(!(m[3] & F::xdigit));
+        assert(!(m[3] & F::blank));
+        assert(!(m[3] & F::alnum));
+        assert( (m[3] & F::graph));
+
+        // L'a'
+        assert(!(m[4] & F::space));
+        assert( (m[4] & F::print));
+        assert(!(m[4] & F::cntrl));
+        assert(!(m[4] & F::upper));
+        assert( (m[4] & F::lower));
+        assert( (m[4] & F::alpha));
+        assert(!(m[4] & F::digit));
+        assert(!(m[4] & F::punct));
+        assert( (m[4] & F::xdigit));
+        assert(!(m[4] & F::blank));
+        assert( (m[4] & F::alnum));
+        assert( (m[4] & F::graph));
+
+        // L'1'
+        assert(!(m[5] & F::space));
+        assert( (m[5] & F::print));
+        assert(!(m[5] & F::cntrl));
+        assert(!(m[5] & F::upper));
+        assert(!(m[5] & F::lower));
+        assert(!(m[5] & F::alpha));
+        assert( (m[5] & F::digit));
+        assert(!(m[5] & F::punct));
+        assert( (m[5] & F::xdigit));
+        assert(!(m[5] & F::blank));
+        assert( (m[5] & F::alnum));
+        assert( (m[5] & F::graph));
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_1.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_1.pass.cpp
new file mode 100644
index 0000000..ac21d48
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_1.pass.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype;
+
+// char narrow(charT c, char dfault) const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<wchar_t> F;
+        const F& f = std::use_facet<F>(l);
+
+        assert(f.narrow(L' ', '*') == ' ');
+        assert(f.narrow(L'A', '*') == 'A');
+        assert(f.narrow(L'\x07', '*') == '\x07');
+        assert(f.narrow(L'.', '*') == '.');
+        assert(f.narrow(L'a', '*') == 'a');
+        assert(f.narrow(L'1', '*') == '1');
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_many.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_many.pass.cpp
new file mode 100644
index 0000000..a9ffcc4
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_many.pass.cpp
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype;
+
+// const charT* narrow(const charT* low, const charT*, char dfault, char* to) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<wchar_t> F;
+        const F& f = std::use_facet<F>(l);
+        std::wstring in(L" A\x07.a1");
+        std::vector<char> v(in.size());
+
+        assert(f.narrow(&in[0], in.data() + in.size(), '*', v.data()) == in.data() + in.size());
+        assert(v[0] == ' ');
+        assert(v[1] == 'A');
+        assert(v[2] == '\x07');
+        assert(v[3] == '.');
+        assert(v[4] == 'a');
+        assert(v[5] == '1');
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_is.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_is.pass.cpp
new file mode 100644
index 0000000..f90c4ee
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_is.pass.cpp
@@ -0,0 +1,44 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype;
+
+// const charT* scan_is(mask m, const charT* low, const charT* high) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+#include <stdio.h>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<wchar_t> F;
+        const F& f = std::use_facet<F>(l);
+        const std::wstring in(L" A\x07.a1");
+        std::vector<F::mask> m(in.size());
+        assert(f.scan_is(F::space, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_is(F::print, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_is(F::cntrl, in.data(), in.data() + in.size()) - in.data() == 2);
+        assert(f.scan_is(F::upper, in.data(), in.data() + in.size()) - in.data() == 1);
+        assert(f.scan_is(F::lower, in.data(), in.data() + in.size()) - in.data() == 4);
+        assert(f.scan_is(F::alpha, in.data(), in.data() + in.size()) - in.data() == 1);
+        assert(f.scan_is(F::digit, in.data(), in.data() + in.size()) - in.data() == 5);
+        assert(f.scan_is(F::punct, in.data(), in.data() + in.size()) - in.data() == 3);
+        assert(f.scan_is(F::xdigit, in.data(), in.data() + in.size()) - in.data() == 1);
+        assert(f.scan_is(F::blank, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_is(F::alnum, in.data(), in.data() + in.size()) - in.data() == 1);
+        assert(f.scan_is(F::graph, in.data(), in.data() + in.size()) - in.data() == 1);
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_not.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_not.pass.cpp
new file mode 100644
index 0000000..6f5b760
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_not.pass.cpp
@@ -0,0 +1,44 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype;
+
+// const charT* scan_not(mask m, const charT* low, const charT* high) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+#include <stdio.h>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<wchar_t> F;
+        const F& f = std::use_facet<F>(l);
+        const std::wstring in(L" A\x07.a1");
+        std::vector<F::mask> m(in.size());
+        assert(f.scan_not(F::space, in.data(), in.data() + in.size()) - in.data() == 1);
+        assert(f.scan_not(F::print, in.data(), in.data() + in.size()) - in.data() == 2);
+        assert(f.scan_not(F::cntrl, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_not(F::upper, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_not(F::lower, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_not(F::alpha, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_not(F::digit, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_not(F::punct, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_not(F::xdigit, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_not(F::blank, in.data(), in.data() + in.size()) - in.data() == 1);
+        assert(f.scan_not(F::alnum, in.data(), in.data() + in.size()) - in.data() == 0);
+        assert(f.scan_not(F::graph, in.data(), in.data() + in.size()) - in.data() == 0);
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_1.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_1.pass.cpp
new file mode 100644
index 0000000..20d0e77
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_1.pass.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype;
+
+// charT tolower(charT) const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<wchar_t> F;
+        const F& f = std::use_facet<F>(l);
+
+        assert(f.tolower(L' ') == L' ');
+        assert(f.tolower(L'A') == L'a');
+        assert(f.tolower(L'\x07') == L'\x07');
+        assert(f.tolower(L'.') == L'.');
+        assert(f.tolower(L'a') == L'a');
+        assert(f.tolower(L'1') == L'1');
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_many.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_many.pass.cpp
new file mode 100644
index 0000000..18e8925
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_many.pass.cpp
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype;
+
+// const charT* tolower(charT* low, const charT* high) const;
+
+#include <locale>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<wchar_t> F;
+        const F& f = std::use_facet<F>(l);
+        std::wstring in(L" A\x07.a1");
+
+        assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size());
+        assert(in[0] == L' ');
+        assert(in[1] == L'a');
+        assert(in[2] == L'\x07');
+        assert(in[3] == L'.');
+        assert(in[4] == L'a');
+        assert(in[5] == L'1');
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_1.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_1.pass.cpp
new file mode 100644
index 0000000..f755679
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_1.pass.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype;
+
+// charT toupper(charT) const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<wchar_t> F;
+        const F& f = std::use_facet<F>(l);
+
+        assert(f.toupper(L' ') == L' ');
+        assert(f.toupper(L'A') == L'A');
+        assert(f.toupper(L'\x07') == L'\x07');
+        assert(f.toupper(L'.') == L'.');
+        assert(f.toupper(L'a') == L'A');
+        assert(f.toupper(L'1') == L'1');
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_many.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_many.pass.cpp
new file mode 100644
index 0000000..7bdd7b7
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_many.pass.cpp
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype;
+
+// const charT* toupper(charT* low, const charT* high) const;
+
+#include <locale>
+#include <string>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<wchar_t> F;
+        const F& f = std::use_facet<F>(l);
+        std::wstring in(L" A\x07.a1");
+
+        assert(f.toupper(&in[0], in.data() + in.size()) == in.data() + in.size());
+        assert(in[0] == L' ');
+        assert(in[1] == L'A');
+        assert(in[2] == L'\x07');
+        assert(in[3] == L'.');
+        assert(in[4] == L'A');
+        assert(in[5] == L'1');
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_1.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_1.pass.cpp
new file mode 100644
index 0000000..296c4e3
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_1.pass.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype;
+
+// charT widen(char c) const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<wchar_t> F;
+        const F& f = std::use_facet<F>(l);
+
+        assert(f.widen(' ') == L' ');
+        assert(f.widen('A') == L'A');
+        assert(f.widen('\x07') == L'\x07');
+        assert(f.widen('.') == L'.');
+        assert(f.widen('a') == L'a');
+        assert(f.widen('1') == L'1');
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_many.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_many.pass.cpp
new file mode 100644
index 0000000..e222f21
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_many.pass.cpp
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class ctype;
+
+// const char* widen(const char* low, const char* high, charT* to) const;
+
+#include <locale>
+#include <string>
+#include <vector>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef std::ctype<wchar_t> F;
+        const F& f = std::use_facet<F>(l);
+        std::string in(" A\x07.a1");
+        std::vector<wchar_t> v(in.size());
+
+        assert(f.widen(&in[0], in.data() + in.size(), v.data()) == in.data() + in.size());
+        assert(v[0] == L' ');
+        assert(v[1] == L'A');
+        assert(v[2] == L'\x07');
+        assert(v[3] == L'.');
+        assert(v[4] == L'a');
+        assert(v[5] == L'1');
+    }
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.virtuals/tested_elsewhere.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.virtuals/tested_elsewhere.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.virtuals/tested_elsewhere.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp b/test/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp
new file mode 100644
index 0000000..67a9c62
--- /dev/null
+++ b/test/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class CharT> 
+// class ctype
+//     : public locale::facet,
+//       public ctype_base
+// {
+// public: 
+//     typedef CharT char_type; 
+// };
+
+#include <locale>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        assert(std::has_facet<std::ctype<wchar_t> >(l));
+        const std::ctype<wchar_t>& f = std::use_facet<std::ctype<wchar_t> >(l);
+        {
+            (void)std::ctype<wchar_t>::id;
+        }
+        static_assert((std::is_same<std::ctype<wchar_t>::char_type, wchar_t>::value), "");
+        static_assert((std::is_base_of<std::ctype_base, std::ctype<wchar_t> >::value), "");
+        static_assert((std::is_base_of<std::locale::facet, std::ctype<wchar_t> >::value), "");
+    }
+}
diff --git a/test/localization/locale.categories/category.messages/locale.messages.byname/nothing_to_do.pass.cpp b/test/localization/locale.categories/category.messages/locale.messages.byname/nothing_to_do.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/category.messages/locale.messages.byname/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/category.messages/locale.messages/ctor.pass.cpp b/test/localization/locale.categories/category.messages/locale.messages/ctor.pass.cpp
new file mode 100644
index 0000000..fc4d676
--- /dev/null
+++ b/test/localization/locale.categories/category.messages/locale.messages/ctor.pass.cpp
@@ -0,0 +1,52 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class messages<charT>
+
+// explicit messages(size_t refs = 0);
+
+#include <locale>
+#include <cassert>
+
+typedef std::messages<char> F;
+
+class my_facet
+    : public F
+{
+public:
+    static int count;
+
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {++count;}
+
+    ~my_facet() {--count;}
+};
+
+int my_facet::count = 0;
+
+int main()
+{
+    {
+        std::locale l(std::locale::classic(), new my_facet);
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f(1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+}
diff --git a/test/localization/locale.categories/category.messages/locale.messages/locale.messages.members/not_testable.pass.cpp b/test/localization/locale.categories/category.messages/locale.messages/locale.messages.members/not_testable.pass.cpp
new file mode 100644
index 0000000..bc91b62
--- /dev/null
+++ b/test/localization/locale.categories/category.messages/locale.messages/locale.messages.members/not_testable.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class messages<charT>
+
+// catalog open(const basic_string<char>& name, const locale&) const;
+
+#include <locale>
+#include <cassert>
+
+// As far as I can tell, the messages facet is untestable.  I have a best
+// effort implementation in the hopes that in the future I will learn how
+// to test it.
+
+template <class CharT>
+class F
+    : public std::messages<CharT>
+{
+public:
+    explicit F(std::size_t refs = 0)
+        : std::messages<CharT>(refs) {}
+};
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/category.messages/locale.messages/locale.messages.virtuals/tested_elsewhere.pass.cpp b/test/localization/locale.categories/category.messages/locale.messages/locale.messages.virtuals/tested_elsewhere.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/category.messages/locale.messages/locale.messages.virtuals/tested_elsewhere.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/category.messages/locale.messages/messages_base.pass.cpp b/test/localization/locale.categories/category.messages/locale.messages/messages_base.pass.cpp
new file mode 100644
index 0000000..f8acf89
--- /dev/null
+++ b/test/localization/locale.categories/category.messages/locale.messages/messages_base.pass.cpp
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class messages_base
+// {
+// public:
+//     typedef unspecified catalog;
+// };
+
+#include <locale>
+#include <type_traits>
+
+int main()
+{
+    std::messages_base mb;
+}
diff --git a/test/localization/locale.categories/category.messages/locale.messages/types.pass.cpp b/test/localization/locale.categories/category.messages/locale.messages/types.pass.cpp
new file mode 100644
index 0000000..5a69681
--- /dev/null
+++ b/test/localization/locale.categories/category.messages/locale.messages/types.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class _CharT>
+// class messages
+//     : public locale::facet,
+//       public messages_base
+// {
+// public:
+//     typedef _CharT               char_type;
+//     typedef basic_string<_CharT> string_type;
+
+#include <locale>
+#include <type_traits>
+
+int main()
+{
+    static_assert((std::is_base_of<std::locale::facet, std::messages<char> >::value), "");
+    static_assert((std::is_base_of<std::messages_base, std::messages<char> >::value), "");
+    static_assert((std::is_base_of<std::locale::facet, std::messages<wchar_t> >::value), "");
+    static_assert((std::is_base_of<std::messages_base, std::messages<wchar_t> >::value), "");
+    static_assert((std::is_same<std::messages<char>::char_type, char>::value), "");
+    static_assert((std::is_same<std::messages<wchar_t>::char_type, wchar_t>::value), "");
+    static_assert((std::is_same<std::messages<char>::string_type, std::string>::value), "");
+    static_assert((std::is_same<std::messages<wchar_t>::string_type, std::wstring>::value), "");
+}
diff --git a/test/localization/locale.categories/category.messages/nothing_to_do.pass.cpp b/test/localization/locale.categories/category.messages/nothing_to_do.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/category.messages/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.money.get/ctor.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.get/ctor.pass.cpp
new file mode 100644
index 0000000..abbd8b5
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.money.get/ctor.pass.cpp
@@ -0,0 +1,52 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class money_get<charT, InputIterator>
+
+// explicit money_get(size_t refs = 0);
+
+#include <locale>
+#include <cassert>
+
+typedef std::money_get<char, const char*> F;
+
+class my_facet
+    : public F
+{
+public:
+    static int count;
+
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {++count;}
+
+    ~my_facet() {--count;}
+};
+
+int my_facet::count = 0;
+
+int main()
+{
+    {
+        std::locale l(std::locale::classic(), new my_facet);
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f(1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp
new file mode 100644
index 0000000..440c140
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp
@@ -0,0 +1,719 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class money_get<charT, InputIterator>
+
+// iter_type get(iter_type b, iter_type e, bool intl, ios_base& iob,
+//               ios_base::iostate& err, long double& v) const;
+
+#include <locale>
+#include <ios>
+#include <streambuf>
+#include <cassert>
+#include "iterators.h"
+
+typedef std::money_get<char, input_iterator<const char*> > Fn;
+
+class my_facet
+    : public Fn
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : Fn(refs) {}
+};
+
+typedef std::money_get<wchar_t, input_iterator<const wchar_t*> > Fw;
+
+class my_facetw
+    : public Fw
+{
+public:
+    explicit my_facetw(std::size_t refs = 0)
+        : Fw(refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::string loc_name("en_US");
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<char, false>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<char, true>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<wchar_t, false>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<wchar_t, true>(loc_name)));
+    {
+        const my_facet f(1);
+        // char, national
+        {   // zero
+            std::string v = "0.00";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // negative one
+            std::string v = "-0.01";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // positive
+            std::string v = "1,234,567.89";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // negative
+            std::string v = "-1,234,567.89";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // negative
+            std::string v = "-1234567.89";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // zero, showbase
+            std::string v = "$0.00";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // zero, showbase
+            std::string v = "$0.00";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+            noshowbase(ios);
+        }
+        {   // negative one, showbase
+            std::string v = "-$0.01";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // negative one, showbase
+            std::string v = "-$0.01";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+            noshowbase(ios);
+        }
+        {   // positive, showbase
+            std::string v = "$1,234,567.89";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // positive, showbase
+            std::string v = "$1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "-$1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "-USD 1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 1);
+            assert(err == std::ios_base::failbit);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "-USD 1,234,567.89";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 1);
+            assert(err == std::ios_base::failbit);
+        }
+    }
+    {
+        const my_facet f(1);
+        // char, international
+        {   // zero
+            std::string v = "0.00";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // negative one
+            std::string v = "-0.01";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // positive
+            std::string v = "1,234,567.89";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // negative
+            std::string v = "-1,234,567.89";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // negative
+            std::string v = "-1234567.89";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // zero, showbase
+            std::string v = "USD 0.00";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // zero, showbase
+            std::string v = "USD 0.00";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+            noshowbase(ios);
+        }
+        {   // negative one, showbase
+            std::string v = "-USD 0.01";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // negative one, showbase
+            std::string v = "-USD 0.01";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+            noshowbase(ios);
+        }
+        {   // positive, showbase
+            std::string v = "USD 1,234,567.89";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // positive, showbase
+            std::string v = "USD 1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "-USD 1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "-$1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 1);
+            assert(err == std::ios_base::failbit);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "-$1,234,567.89";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 1);
+            assert(err == std::ios_base::failbit);
+        }
+    }
+    {
+        const my_facetw f(1);
+        // wchar_t, national
+        {   // zero
+            std::wstring v = L"0.00";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // negative one
+            std::wstring v = L"-0.01";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // positive
+            std::wstring v = L"1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // negative
+            std::wstring v = L"-1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // negative
+            std::wstring v = L"-1234567.89";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // zero, showbase
+            std::wstring v = L"$0.00";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // zero, showbase
+            std::wstring v = L"$0.00";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+            noshowbase(ios);
+        }
+        {   // negative one, showbase
+            std::wstring v = L"-$0.01";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // negative one, showbase
+            std::wstring v = L"-$0.01";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+            noshowbase(ios);
+        }
+        {   // positive, showbase
+            std::wstring v = L"$1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // positive, showbase
+            std::wstring v = L"$1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"-$1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"-USD 1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 1);
+            assert(err == std::ios_base::failbit);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"-USD 1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 1);
+            assert(err == std::ios_base::failbit);
+        }
+    }
+    {
+        const my_facetw f(1);
+        // wchar_t, international
+        {   // zero
+            std::wstring v = L"0.00";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // negative one
+            std::wstring v = L"-0.01";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // positive
+            std::wstring v = L"1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // negative
+            std::wstring v = L"-1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // negative
+            std::wstring v = L"-1234567.89";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // zero, showbase
+            std::wstring v = L"USD 0.00";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // zero, showbase
+            std::wstring v = L"USD 0.00";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+            noshowbase(ios);
+        }
+        {   // negative one, showbase
+            std::wstring v = L"-USD 0.01";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // negative one, showbase
+            std::wstring v = L"-USD 0.01";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+            noshowbase(ios);
+        }
+        {   // positive, showbase
+            std::wstring v = L"USD 1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // positive, showbase
+            std::wstring v = L"USD 1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"-USD 1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"-$1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 1);
+            assert(err == std::ios_base::failbit);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"-$1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 1);
+            assert(err == std::ios_base::failbit);
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
new file mode 100644
index 0000000..df38b1f
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
@@ -0,0 +1,723 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class money_get<charT, InputIterator>
+
+// iter_type get(iter_type b, iter_type e, bool intl, ios_base& iob,
+//               ios_base::iostate& err, long double& v) const;
+
+#include <locale>
+#include <ios>
+#include <streambuf>
+#include <cassert>
+#include "iterators.h"
+
+typedef std::money_get<char, input_iterator<const char*> > Fn;
+
+class my_facet
+    : public Fn
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : Fn(refs) {}
+};
+
+typedef std::money_get<wchar_t, input_iterator<const wchar_t*> > Fw;
+
+class my_facetw
+    : public Fw
+{
+public:
+    explicit my_facetw(std::size_t refs = 0)
+        : Fw(refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::string loc_name("fr_FR");
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<char, false>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<char, true>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<wchar_t, false>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<wchar_t, true>(loc_name)));
+    {
+        const my_facet f(1);
+        // char, national
+        {   // zero
+            std::string v = "0,00";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // negative one
+            std::string v = "0,01 -";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // positive
+            std::string v = "1 234 567,89 ";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // negative
+            std::string v = "1 234 567,89 -";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // negative
+            std::string v = "1234567,89 -";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // zero, showbase
+            std::string v = "0,00 Eu";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // zero, showbase
+            std::string v = "0,00 Eu";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+            noshowbase(ios);
+        }
+        {   // negative one, showbase
+            std::string v = "0,01 Eu-";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // negative one, showbase
+            std::string v = "0,01 Eu-";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+            noshowbase(ios);
+        }
+        {   // positive, showbase
+            std::string v = "1 234 567,89 Eu";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // positive, showbase
+            std::string v = "1 234 567,89 Eu";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "1 234 567,89 Eu-";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "1 234 567,89 EUR -";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 14);
+            assert(err == std::ios_base::failbit);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "1 234 567,89 EUR -";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 14);
+            assert(err == std::ios_base::goodbit);
+            assert(ex == 123456789);
+        }
+    }
+    {
+        const my_facet f(1);
+        // char, international
+        {   // zero
+            std::string v = "0,00";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // negative one
+            std::string v = "0,01 -";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // positive
+            std::string v = "1 234 567,89 ";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // negative
+            std::string v = "1 234 567,89 -";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // negative
+            std::string v = "1234567,89 -";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // zero, showbase
+            std::string v = "0,00 EUR ";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // zero, showbase
+            std::string v = "0,00 EUR ";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+            noshowbase(ios);
+        }
+        {   // negative one, showbase
+            std::string v = "0,01 EUR -";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // negative one, showbase
+            std::string v = "0,01 EUR -";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+            noshowbase(ios);
+        }
+        {   // positive, showbase
+            std::string v = "1 234 567,89 EUR ";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // positive, showbase
+            std::string v = "1 234 567,89 EUR ";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "1 234 567,89 EUR -";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "1 234 567,89 Eu-";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 14);
+            assert(err == std::ios_base::failbit);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "1 234 567,89 Eu-";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 14);
+            assert(err == std::ios_base::goodbit);
+            assert(ex == 123456789);
+        }
+    }
+    {
+        const my_facetw f(1);
+        // wchar_t, national
+        {   // zero
+            std::wstring v = L"0,00";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // negative one
+            std::wstring v = L"0,01 -";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // positive
+            std::wstring v = L"1 234 567,89 ";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // negative
+            std::wstring v = L"1 234 567,89 -";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // negative
+            std::wstring v = L"1234567,89 -";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // zero, showbase
+            std::wstring v = L"0,00 Eu";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // zero, showbase
+            std::wstring v = L"0,00 Eu";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+            noshowbase(ios);
+        }
+        {   // negative one, showbase
+            std::wstring v = L"0,01 Eu-";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // negative one, showbase
+            std::wstring v = L"0,01 Eu-";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+            noshowbase(ios);
+        }
+        {   // positive, showbase
+            std::wstring v = L"1 234 567,89 Eu";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // positive, showbase
+            std::wstring v = L"1 234 567,89 Eu";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"1 234 567,89 Eu-";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"1 234 567,89 EUR -";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 14);
+            assert(err == std::ios_base::failbit);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"1 234 567,89 EUR -";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 14);
+            assert(err == std::ios_base::goodbit);
+            assert(ex == 123456789);
+        }
+    }
+    {
+        const my_facetw f(1);
+        // wchar_t, international
+        {   // zero
+            std::wstring v = L"0,00";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // negative one
+            std::wstring v = L"0,01 -";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // positive
+            std::wstring v = L"1 234 567,89 ";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // negative
+            std::wstring v = L"1 234 567,89 -";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // negative
+            std::wstring v = L"1234567,89 -";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // zero, showbase
+            std::wstring v = L"0,00 EUR ";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // zero, showbase
+            std::wstring v = L"0,00 EUR ";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+            noshowbase(ios);
+        }
+        {   // negative one, showbase
+            std::wstring v = L"0,01 EUR -";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // negative one, showbase
+            std::wstring v = L"0,01 EUR -";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+            noshowbase(ios);
+        }
+        {   // positive, showbase
+            std::wstring v = L"1 234 567,89 EUR ";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // positive, showbase
+            std::wstring v = L"1 234 567,89 EUR ";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"1 234 567,89 EUR -";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"1 234 567,89 Eu-";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 14);
+            assert(err == std::ios_base::failbit);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"1 234 567,89 Eu-";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 14);
+            assert(err == std::ios_base::goodbit);
+            assert(ex == 123456789);
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp
new file mode 100644
index 0000000..a20d913
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp
@@ -0,0 +1,723 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class money_get<charT, InputIterator>
+
+// iter_type get(iter_type b, iter_type e, bool intl, ios_base& iob,
+//               ios_base::iostate& err, long double& v) const;
+
+#include <locale>
+#include <ios>
+#include <streambuf>
+#include <cassert>
+#include "iterators.h"
+
+typedef std::money_get<char, input_iterator<const char*> > Fn;
+
+class my_facet
+    : public Fn
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : Fn(refs) {}
+};
+
+typedef std::money_get<wchar_t, input_iterator<const wchar_t*> > Fw;
+
+class my_facetw
+    : public Fw
+{
+public:
+    explicit my_facetw(std::size_t refs = 0)
+        : Fw(refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::string loc_name("ru_RU");
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<char, false>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<char, true>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<wchar_t, false>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<wchar_t, true>(loc_name)));
+    {
+        const my_facet f(1);
+        // char, national
+        {   // zero
+            std::string v = "0,00 ";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // negative one
+            std::string v = "-0,01 ";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // positive
+            std::string v = "1 234 567,89 ";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // negative
+            std::string v = "-1 234 567,89 ";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // negative
+            std::string v = "-1234567,89 ";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // zero, showbase
+            std::string v = "0,00 \xD1\x80\xD1\x83\xD0\xB1"".";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 5);
+            assert(err == std::ios_base::goodbit);
+            assert(ex == 0);
+        }
+        {   // zero, showbase
+            std::string v = "0,00 \xD1\x80\xD1\x83\xD0\xB1"".";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+            noshowbase(ios);
+        }
+        {   // negative one, showbase
+            std::string v = "-0,01 \xD1\x80\xD1\x83\xD0\xB1"".";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 6);
+            assert(err == std::ios_base::goodbit);
+            assert(ex == -1);
+        }
+        {   // negative one, showbase
+            std::string v = "-0,01 \xD1\x80\xD1\x83\xD0\xB1"".";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+            noshowbase(ios);
+        }
+        {   // positive, showbase
+            std::string v = "1 234 567,89 \xD1\x80\xD1\x83\xD0\xB1"".";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 13);
+            assert(err == std::ios_base::goodbit);
+            assert(ex == 123456789);
+        }
+        {   // positive, showbase
+            std::string v = "1 234 567,89 \xD1\x80\xD1\x83\xD0\xB1"".";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "-1 234 567,89 \xD1\x80\xD1\x83\xD0\xB1"".";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "-1 234 567,89 RUR ";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 14);
+            assert(err == std::ios_base::failbit);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "-1 234 567,89 RUR ";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 14);
+            assert(err == std::ios_base::goodbit);
+            assert(ex == -123456789);
+        }
+    }
+    {
+        const my_facet f(1);
+        // char, international
+        {   // zero
+            std::string v = "0,00";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // negative one
+            std::string v = "-0,01 ";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // positive
+            std::string v = "1 234 567,89 ";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // negative
+            std::string v = "-1 234 567,89 ";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // negative
+            std::string v = "-1234567,89 ";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // zero, showbase
+            std::string v = "0,00 RUR ";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 5);
+            assert(err == std::ios_base::goodbit);
+            assert(ex == 0);
+        }
+        {   // zero, showbase
+            std::string v = "0,00 RUR ";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+            noshowbase(ios);
+        }
+        {   // negative one, showbase
+            std::string v = "-0,01 RUR ";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 6);
+            assert(err == std::ios_base::goodbit);
+            assert(ex == -1);
+        }
+        {   // negative one, showbase
+            std::string v = "-0,01 RUR ";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+            noshowbase(ios);
+        }
+        {   // positive, showbase
+            std::string v = "1 234 567,89 RUR ";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 13);
+            assert(err == std::ios_base::goodbit);
+            assert(ex == 123456789);
+        }
+        {   // positive, showbase
+            std::string v = "1 234 567,89 RUR ";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "-1 234 567,89 RUR ";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "-1 234 567,89 \xD1\x80\xD1\x83\xD0\xB1"".";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 14);
+            assert(err == std::ios_base::failbit);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "-1 234 567,89 \xD1\x80\xD1\x83\xD0\xB1"".";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 14);
+            assert(err == std::ios_base::goodbit);
+            assert(ex == -123456789);
+        }
+    }
+    {
+        const my_facetw f(1);
+        // wchar_t, national
+        {   // zero
+            std::wstring v = L"0,00";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // negative one
+            std::wstring v = L"-0,01 ";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // positive
+            std::wstring v = L"1 234 567,89 ";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // negative
+            std::wstring v = L"-1 234 567,89 ";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // negative
+            std::wstring v = L"-1234567,89 ";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // zero, showbase
+            std::wstring v = L"0,00 \x440\x443\x431"".";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 5);
+            assert(err == std::ios_base::goodbit);
+            assert(ex == 0);
+        }
+        {   // zero, showbase
+            std::wstring v = L"0,00 \x440\x443\x431"".";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+            noshowbase(ios);
+        }
+        {   // negative one, showbase
+            std::wstring v = L"-0,01 \x440\x443\x431"".";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 6);
+            assert(err == std::ios_base::goodbit);
+            assert(ex == -1);
+        }
+        {   // negative one, showbase
+            std::wstring v = L"-0,01 \x440\x443\x431"".";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+            noshowbase(ios);
+        }
+        {   // positive, showbase
+            std::wstring v = L"1 234 567,89 \x440\x443\x431"".";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 13);
+            assert(err == std::ios_base::goodbit);
+            assert(ex == 123456789);
+        }
+        {   // positive, showbase
+            std::wstring v = L"1 234 567,89 \x440\x443\x431"".";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"-1 234 567,89 \x440\x443\x431"".";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"-1 234 567,89 RUR ";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 14);
+            assert(err == std::ios_base::failbit);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"-1 234 567,89 RUR ";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 14);
+            assert(err == std::ios_base::goodbit);
+            assert(ex == -123456789);
+        }
+    }
+    {
+        const my_facetw f(1);
+        // wchar_t, international
+        {   // zero
+            std::wstring v = L"0,00";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // negative one
+            std::wstring v = L"-0,01 ";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // positive
+            std::wstring v = L"1 234 567,89 ";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // negative
+            std::wstring v = L"-1 234 567,89 ";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // negative
+            std::wstring v = L"-1234567,89 ";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // zero, showbase
+            std::wstring v = L"0,00 RUR ";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 5);
+            assert(err == std::ios_base::goodbit);
+            assert(ex == 0);
+        }
+        {   // zero, showbase
+            std::wstring v = L"0,00 RUR ";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+            noshowbase(ios);
+        }
+        {   // negative one, showbase
+            std::wstring v = L"-0,01 RUR ";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 6);
+            assert(err == std::ios_base::goodbit);
+            assert(ex == -1);
+        }
+        {   // negative one, showbase
+            std::wstring v = L"-0,01 RUR ";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+            noshowbase(ios);
+        }
+        {   // positive, showbase
+            std::wstring v = L"1 234 567,89 RUR ";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 13);
+            assert(err == std::ios_base::goodbit);
+            assert(ex == 123456789);
+        }
+        {   // positive, showbase
+            std::wstring v = L"1 234 567,89 RUR ";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"-1 234 567,89 RUR ";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"-1 234 567,89 \x440\x443\x431"".";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 14);
+            assert(err == std::ios_base::failbit);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"-1 234 567,89 \x440\x443\x431"".";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 14);
+            assert(err == std::ios_base::goodbit);
+            assert(ex == -123456789);
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp
new file mode 100644
index 0000000..6bf3871
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp
@@ -0,0 +1,719 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class money_get<charT, InputIterator>
+
+// iter_type get(iter_type b, iter_type e, bool intl, ios_base& iob,
+//               ios_base::iostate& err, long double& v) const;
+
+#include <locale>
+#include <ios>
+#include <streambuf>
+#include <cassert>
+#include "iterators.h"
+
+typedef std::money_get<char, input_iterator<const char*> > Fn;
+
+class my_facet
+    : public Fn
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : Fn(refs) {}
+};
+
+typedef std::money_get<wchar_t, input_iterator<const wchar_t*> > Fw;
+
+class my_facetw
+    : public Fw
+{
+public:
+    explicit my_facetw(std::size_t refs = 0)
+        : Fw(refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::string loc_name("zh_CN");
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<char, false>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<char, true>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<wchar_t, false>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<wchar_t, true>(loc_name)));
+    {
+        const my_facet f(1);
+        // char, national
+        {   // zero
+            std::string v = "0.00";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // negative one
+            std::string v = "-0.01";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // positive
+            std::string v = "1,234,567.89";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // negative
+            std::string v = "-1,234,567.89";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // negative
+            std::string v = "-1234567.89";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // zero, showbase
+            std::string v = "\xEF\xBF\xA5""0.00";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // zero, showbase
+            std::string v = "\xEF\xBF\xA5""0.00";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+            noshowbase(ios);
+        }
+        {   // negative one, showbase
+            std::string v = "\xEF\xBF\xA5""-0.01";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // negative one, showbase
+            std::string v = "\xEF\xBF\xA5""-0.01";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+            noshowbase(ios);
+        }
+        {   // positive, showbase
+            std::string v = "\xEF\xBF\xA5""1,234,567.89";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // positive, showbase
+            std::string v = "\xEF\xBF\xA5""1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "\xEF\xBF\xA5""-1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "CNY -1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 0);
+            assert(err == std::ios_base::failbit);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "CNY -1,234,567.89";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 0);
+            assert(err == std::ios_base::failbit);
+        }
+    }
+    {
+        const my_facet f(1);
+        // char, international
+        {   // zero
+            std::string v = "0.00";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // negative one
+            std::string v = "-0.01";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // positive
+            std::string v = "1,234,567.89";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // negative
+            std::string v = "-1,234,567.89";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // negative
+            std::string v = "-1234567.89";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // zero, showbase
+            std::string v = "CNY 0.00";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // zero, showbase
+            std::string v = "CNY 0.00";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+            noshowbase(ios);
+        }
+        {   // negative one, showbase
+            std::string v = "CNY -0.01";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // negative one, showbase
+            std::string v = "CNY -0.01";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+            noshowbase(ios);
+        }
+        {   // positive, showbase
+            std::string v = "CNY 1,234,567.89";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // positive, showbase
+            std::string v = "CNY 1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "CNY -1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "\xEF\xBF\xA5""-1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 0);
+            assert(err == std::ios_base::failbit);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "\xEF\xBF\xA5""-1,234,567.89";
+            typedef input_iterator<const char*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 0);
+            assert(err == std::ios_base::failbit);
+        }
+    }
+    {
+        const my_facetw f(1);
+        // wchar_t, national
+        {   // zero
+            std::wstring v = L"0.00";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // negative one
+            std::wstring v = L"-0.01";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // positive
+            std::wstring v = L"1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // negative
+            std::wstring v = L"-1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // negative
+            std::wstring v = L"-1234567.89";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // zero, showbase
+            std::wstring v = L"\xFFE5""0.00";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // zero, showbase
+            std::wstring v = L"\xFFE5""0.00";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+            noshowbase(ios);
+        }
+        {   // negative one, showbase
+            std::wstring v = L"\xFFE5""-0.01";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // negative one, showbase
+            std::wstring v = L"\xFFE5""-0.01";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+            noshowbase(ios);
+        }
+        {   // positive, showbase
+            std::wstring v = L"\xFFE5""1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // positive, showbase
+            std::wstring v = L"\xFFE5""1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"\xFFE5""-1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"CNY -1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 0);
+            assert(err == std::ios_base::failbit);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"CNY -1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 0);
+            assert(err == std::ios_base::failbit);
+        }
+    }
+    {
+        const my_facetw f(1);
+        // wchar_t, international
+        {   // zero
+            std::wstring v = L"0.00";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // negative one
+            std::wstring v = L"-0.01";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // positive
+            std::wstring v = L"1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // negative
+            std::wstring v = L"-1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // negative
+            std::wstring v = L"-1234567.89";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+        }
+        {   // zero, showbase
+            std::wstring v = L"CNY 0.00";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+        }
+        {   // zero, showbase
+            std::wstring v = L"CNY 0.00";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 0);
+            noshowbase(ios);
+        }
+        {   // negative one, showbase
+            std::wstring v = L"CNY -0.01";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+        }
+        {   // negative one, showbase
+            std::wstring v = L"CNY -0.01";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -1);
+            noshowbase(ios);
+        }
+        {   // positive, showbase
+            std::wstring v = L"CNY 1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+        }
+        {   // positive, showbase
+            std::wstring v = L"CNY 1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == 123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"CNY -1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == -123456789);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"\xFFE5""-1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 0);
+            assert(err == std::ios_base::failbit);
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"\xFFE5""-1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            long double ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 0);
+            assert(err == std::ios_base::failbit);
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp
new file mode 100644
index 0000000..e2f2ecc
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp
@@ -0,0 +1,727 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class money_get<charT, InputIterator>
+
+// iter_type get(iter_type b, iter_type e, bool intl, ios_base& iob,
+//               ios_base::iostate& err, string_type& v) const;
+
+#include <locale>
+#include <ios>
+#include <streambuf>
+#include <cassert>
+#include "iterators.h"
+
+typedef std::money_get<char, input_iterator<const char*> > Fn;
+
+class my_facet
+    : public Fn
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : Fn(refs) {}
+};
+
+typedef std::money_get<wchar_t, input_iterator<const wchar_t*> > Fw;
+
+class my_facetw
+    : public Fw
+{
+public:
+    explicit my_facetw(std::size_t refs = 0)
+        : Fw(refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::string loc_name("en_US");
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<char, false>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<char, true>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<wchar_t, false>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<wchar_t, true>(loc_name)));
+    {
+        const my_facet f(1);
+        // char, national
+        {   // zero
+            std::string v = "0.00";
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "0");
+        }
+        {   // negative one
+            std::string v = "-0.01";
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "-1");
+        }
+        {   // positive
+            std::string v = "1,234,567.89";
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "123456789");
+        }
+        {   // negative
+            std::string v = "-1,234,567.89";
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "-123456789");
+        }
+        {   // negative
+            std::string v = "-1234567.89";
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "-123456789");
+        }
+        {   // zero, showbase
+            std::string v = "$0.00";
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "0");
+        }
+        {   // zero, showbase
+            std::string v = "$0.00";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "0");
+            noshowbase(ios);
+        }
+        {   // negative one, showbase
+            std::string v = "-$0.01";
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "-1");
+        }
+        {   // negative one, showbase
+            std::string v = "-$0.01";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "-1");
+            noshowbase(ios);
+        }
+        {   // positive, showbase
+            std::string v = "$1,234,567.89";
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "123456789");
+        }
+        {   // positive, showbase
+            std::string v = "$1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "123456789");
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "-$1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "-123456789");
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "-USD 1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 1);
+            assert(err == std::ios_base::failbit);
+            assert(ex == "");
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "-USD 1,234,567.89";
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 1);
+            assert(err == std::ios_base::failbit);
+            assert(ex == "");
+        }
+    }
+    {
+        const my_facet f(1);
+        // char, international
+        {   // zero
+            std::string v = "0.00";
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "0");
+        }
+        {   // negative one
+            std::string v = "-0.01";
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "-1");
+        }
+        {   // positive
+            std::string v = "1,234,567.89";
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "123456789");
+        }
+        {   // negative
+            std::string v = "-1,234,567.89";
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "-123456789");
+        }
+        {   // negative
+            std::string v = "-1234567.89";
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "-123456789");
+        }
+        {   // zero, showbase
+            std::string v = "USD 0.00";
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "0");
+        }
+        {   // zero, showbase
+            std::string v = "USD 0.00";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "0");
+            noshowbase(ios);
+        }
+        {   // negative one, showbase
+            std::string v = "-USD 0.01";
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "-1");
+        }
+        {   // negative one, showbase
+            std::string v = "-USD 0.01";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "-1");
+            noshowbase(ios);
+        }
+        {   // positive, showbase
+            std::string v = "USD 1,234,567.89";
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "123456789");
+        }
+        {   // positive, showbase
+            std::string v = "USD 1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "123456789");
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "-USD 1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == "-123456789");
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "-$1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 1);
+            assert(err == std::ios_base::failbit);
+            assert(ex == "");
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::string v = "-$1,234,567.89";
+            typedef input_iterator<const char*> I;
+            std::string ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 1);
+            assert(err == std::ios_base::failbit);
+            assert(ex == "");
+        }
+    }
+    {
+        const my_facetw f(1);
+        // wchar_t, national
+        {   // zero
+            std::wstring v = L"0.00";
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"0");
+        }
+        {   // negative one
+            std::wstring v = L"-0.01";
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"-1");
+        }
+        {   // positive
+            std::wstring v = L"1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"123456789");
+        }
+        {   // negative
+            std::wstring v = L"-1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"-123456789");
+        }
+        {   // negative
+            std::wstring v = L"-1234567.89";
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"-123456789");
+        }
+        {   // zero, showbase
+            std::wstring v = L"$0.00";
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"0");
+        }
+        {   // zero, showbase
+            std::wstring v = L"$0.00";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"0");
+            noshowbase(ios);
+        }
+        {   // negative one, showbase
+            std::wstring v = L"-$0.01";
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"-1");
+        }
+        {   // negative one, showbase
+            std::wstring v = L"-$0.01";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"-1");
+            noshowbase(ios);
+        }
+        {   // positive, showbase
+            std::wstring v = L"$1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"123456789");
+        }
+        {   // positive, showbase
+            std::wstring v = L"$1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"123456789");
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"-$1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"-123456789");
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"-USD 1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 1);
+            assert(err == std::ios_base::failbit);
+            assert(ex == L"");
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"-USD 1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                false, ios, err, ex);
+            assert(iter.base() == v.data() + 1);
+            assert(err == std::ios_base::failbit);
+            assert(ex == L"");
+        }
+    }
+    {
+        const my_facetw f(1);
+        // wchar_t, international
+        {   // zero
+            std::wstring v = L"0.00";
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"0");
+        }
+        {   // negative one
+            std::wstring v = L"-0.01";
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"-1");
+        }
+        {   // positive
+            std::wstring v = L"1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"123456789");
+        }
+        {   // negative
+            std::wstring v = L"-1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"-123456789");
+        }
+        {   // negative
+            std::wstring v = L"-1234567.89";
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"-123456789");
+        }
+        {   // zero, showbase
+            std::wstring v = L"USD 0.00";
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"0");
+        }
+        {   // zero, showbase
+            std::wstring v = L"USD 0.00";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"0");
+            noshowbase(ios);
+        }
+        {   // negative one, showbase
+            std::wstring v = L"-USD 0.01";
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"-1");
+        }
+        {   // negative one, showbase
+            std::wstring v = L"-USD 0.01";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"-1");
+            noshowbase(ios);
+        }
+        {   // positive, showbase
+            std::wstring v = L"USD 1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"123456789");
+        }
+        {   // positive, showbase
+            std::wstring v = L"USD 1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"123456789");
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"-USD 1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + v.size());
+            assert(err == std::ios_base::eofbit);
+            assert(ex == L"-123456789");
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"-$1,234,567.89";
+            showbase(ios);
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 1);
+            assert(err == std::ios_base::failbit);
+            assert(ex == L"");
+            noshowbase(ios);
+        }
+        {   // negative, showbase
+            std::wstring v = L"-$1,234,567.89";
+            typedef input_iterator<const wchar_t*> I;
+            std::wstring ex;
+            std::ios_base::iostate err = std::ios_base::goodbit;
+            I iter = f.get(I(v.data()), I(v.data() + v.size()),
+                                                true, ios, err, ex);
+            assert(iter.base() == v.data() + 1);
+            assert(err == std::ios_base::failbit);
+            assert(ex == L"");
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/iterators.h b/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/iterators.h
new file mode 100644
index 0000000..5e3ff31
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/iterators.h
@@ -0,0 +1,55 @@
+#ifndef ITERATORS_H
+#define ITERATORS_H
+
+#include <iterator>
+
+template <class It>
+class input_iterator
+{
+    It it_;
+
+    template <class U> friend class input_iterator;
+public:
+    typedef          std::input_iterator_tag                   iterator_category;
+    typedef typename std::iterator_traits<It>::value_type      value_type;
+    typedef typename std::iterator_traits<It>::difference_type difference_type;
+    typedef It                                                 pointer;
+    typedef typename std::iterator_traits<It>::reference       reference;
+
+    It base() const {return it_;}
+
+    input_iterator() : it_() {}
+    explicit input_iterator(It it) : it_(it) {}
+    template <class U>
+        input_iterator(const input_iterator<U>& u) :it_(u.it_) {}
+
+    reference operator*() const {return *it_;}
+    pointer operator->() const {return it_;}
+
+    input_iterator& operator++() {++it_; return *this;}
+    input_iterator operator++(int)
+        {input_iterator tmp(*this); ++(*this); return tmp;}
+
+    friend bool operator==(const input_iterator& x, const input_iterator& y)
+        {return x.it_ == y.it_;}
+    friend bool operator!=(const input_iterator& x, const input_iterator& y)
+        {return !(x == y);}
+};
+
+template <class T, class U>
+inline
+bool
+operator==(const input_iterator<T>& x, const input_iterator<U>& y)
+{
+    return x.base() == y.base();
+}
+
+template <class T, class U>
+inline
+bool
+operator!=(const input_iterator<T>& x, const input_iterator<U>& y)
+{
+    return !(x == y);
+}
+
+#endif
diff --git a/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.virtuals/tested_elsewhere.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.virtuals/tested_elsewhere.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.virtuals/tested_elsewhere.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.money.get/types.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.get/types.pass.cpp
new file mode 100644
index 0000000..2e6e2dc
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.money.get/types.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class CharT, class InputIterator = istreambuf_iterator<CharT> >
+// class money_get
+//     : public locale::facet
+// {
+// public:
+//     typedef CharT                   char_type;
+//     typedef InputIterator           iter_type;
+//     typedef basic_string<char_type> string_type;
+
+#include <locale>
+#include <type_traits>
+
+int main()
+{
+    static_assert((std::is_base_of<std::locale::facet, std::money_get<char> >::value), "");
+    static_assert((std::is_base_of<std::locale::facet, std::money_get<wchar_t> >::value), "");
+    static_assert((std::is_same<std::money_get<char>::char_type, char>::value), "");
+    static_assert((std::is_same<std::money_get<wchar_t>::char_type, wchar_t>::value), "");
+    static_assert((std::is_same<std::money_get<char>::iter_type, std::istreambuf_iterator<char> >::value), "");
+    static_assert((std::is_same<std::money_get<wchar_t>::iter_type, std::istreambuf_iterator<wchar_t> >::value), "");
+    static_assert((std::is_same<std::money_get<char>::string_type, std::string>::value), "");
+    static_assert((std::is_same<std::money_get<wchar_t>::string_type, std::wstring>::value), "");
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.money.put/ctor.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.put/ctor.pass.cpp
new file mode 100644
index 0000000..e667ae0
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.money.put/ctor.pass.cpp
@@ -0,0 +1,52 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class money_put<charT, OutputIterator>
+
+// explicit money_put(size_t refs = 0);
+
+#include <locale>
+#include <cassert>
+
+typedef std::money_put<char, char*> F;
+
+class my_facet
+    : public F
+{
+public:
+    static int count;
+
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {++count;}
+
+    ~my_facet() {--count;}
+};
+
+int my_facet::count = 0;
+
+int main()
+{
+    {
+        std::locale l(std::locale::classic(), new my_facet);
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f(1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/iterators.h b/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/iterators.h
new file mode 100644
index 0000000..791e416
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/iterators.h
@@ -0,0 +1,33 @@
+#ifndef ITERATORS_H
+#define ITERATORS_H
+
+#include <iterator>
+
+template <class It>
+class output_iterator
+{
+    It it_;
+
+    template <class U> friend class output_iterator;
+public:
+    typedef          std::output_iterator_tag                  iterator_category;
+    typedef typename std::iterator_traits<It>::value_type      value_type;
+    typedef typename std::iterator_traits<It>::difference_type difference_type;
+    typedef It                                                 pointer;
+    typedef typename std::iterator_traits<It>::reference       reference;
+
+    It base() const {return it_;}
+
+    output_iterator() : it_() {}
+    explicit output_iterator(It it) : it_(it) {}
+    template <class U>
+        output_iterator(const output_iterator<U>& u) :it_(u.it_) {}
+
+    reference operator*() const {return *it_;}
+
+    output_iterator& operator++() {++it_; return *this;}
+    output_iterator operator++(int)
+        {output_iterator tmp(*this); ++(*this); return tmp;}
+};
+
+#endif
diff --git a/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp
new file mode 100644
index 0000000..003a9fe
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp
@@ -0,0 +1,490 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class money_put<charT, OutputIterator>
+
+// iter_type put(iter_type s, bool intl, ios_base& f, char_type fill,
+//               long double units) const;
+
+#include <locale>
+#include <ios>
+#include <streambuf>
+#include <cassert>
+#include "iterators.h"
+
+typedef std::money_put<char, output_iterator<char*> > Fn;
+
+class my_facet
+    : public Fn
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : Fn(refs) {}
+};
+
+typedef std::money_put<wchar_t, output_iterator<wchar_t*> > Fw;
+
+class my_facetw
+    : public Fw
+{
+public:
+    explicit my_facetw(std::size_t refs = 0)
+        : Fw(refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::string loc_name("en_US");
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<char, false>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<char, true>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<wchar_t, false>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<wchar_t, true>(loc_name)));
+{
+    const my_facet f(1);
+    // char, national
+    {   // zero
+        long double v = 0;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0.00");
+    }
+    {   // negative one
+        long double v = -1;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-0.01");
+    }
+    {   // positive
+        long double v = 123456789;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1,234,567.89");
+    }
+    {   // negative
+        long double v = -123456789;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1,234,567.89");
+    }
+    {   // zero, showbase
+        long double v = 0;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "$0.00");
+    }
+    {   // negative one, showbase
+        long double v = -1;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-$0.01");
+    }
+    {   // positive, showbase
+        long double v = 123456789;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "$1,234,567.89");
+    }
+    {   // negative, showbase
+        long double v = -123456789;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-$1,234,567.89");
+    }
+    {   // negative, showbase, left
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        left(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-$1,234,567.89      ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, internal
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        internal(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-$      1,234,567.89");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, right
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        right(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "      -$1,234,567.89");
+        assert(ios.width() == 0);
+    }
+
+    // char, international
+    noshowbase(ios);
+    ios.unsetf(std::ios_base::adjustfield);
+    {   // zero
+        long double v = 0;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0.00");
+    }
+    {   // negative one
+        long double v = -1;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-0.01");
+    }
+    {   // positive
+        long double v = 123456789;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1,234,567.89");
+    }
+    {   // negative
+        long double v = -123456789;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1,234,567.89");
+    }
+    {   // zero, showbase
+        long double v = 0;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "USD 0.00");
+    }
+    {   // negative one, showbase
+        long double v = -1;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-USD 0.01");
+    }
+    {   // positive, showbase
+        long double v = 123456789;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "USD 1,234,567.89");
+    }
+    {   // negative, showbase
+        long double v = -123456789;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-USD 1,234,567.89");
+    }
+    {   // negative, showbase, left
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        left(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-USD 1,234,567.89   ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, internal
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        internal(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-USD    1,234,567.89");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, right
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        right(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "   -USD 1,234,567.89");
+        assert(ios.width() == 0);
+    }
+}
+{
+
+    const my_facetw f(1);
+    // wchar_t, national
+    noshowbase(ios);
+    ios.unsetf(std::ios_base::adjustfield);
+    {   // zero
+        long double v = 0;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"0.00");
+    }
+    {   // negative one
+        long double v = -1;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-0.01");
+    }
+    {   // positive
+        long double v = 123456789;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1,234,567.89");
+    }
+    {   // negative
+        long double v = -123456789;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-1,234,567.89");
+    }
+    {   // zero, showbase
+        long double v = 0;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"$0.00");
+    }
+    {   // negative one, showbase
+        long double v = -1;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-$0.01");
+    }
+    {   // positive, showbase
+        long double v = 123456789;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"$1,234,567.89");
+    }
+    {   // negative, showbase
+        long double v = -123456789;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-$1,234,567.89");
+    }
+    {   // negative, showbase, left
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        left(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-$1,234,567.89      ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, internal
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        internal(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-$      1,234,567.89");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, right
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        right(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"      -$1,234,567.89");
+        assert(ios.width() == 0);
+    }
+
+    // wchar_t, international
+    noshowbase(ios);
+    ios.unsetf(std::ios_base::adjustfield);
+    {   // zero
+        long double v = 0;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"0.00");
+    }
+    {   // negative one
+        long double v = -1;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-0.01");
+    }
+    {   // positive
+        long double v = 123456789;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1,234,567.89");
+    }
+    {   // negative
+        long double v = -123456789;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-1,234,567.89");
+    }
+    {   // zero, showbase
+        long double v = 0;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"USD 0.00");
+    }
+    {   // negative one, showbase
+        long double v = -1;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-USD 0.01");
+    }
+    {   // positive, showbase
+        long double v = 123456789;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"USD 1,234,567.89");
+    }
+    {   // negative, showbase
+        long double v = -123456789;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-USD 1,234,567.89");
+    }
+    {   // negative, showbase, left
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        left(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-USD 1,234,567.89   ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, internal
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        internal(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-USD    1,234,567.89");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, right
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        right(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"   -USD 1,234,567.89");
+        assert(ios.width() == 0);
+    }
+}
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
new file mode 100644
index 0000000..34e9ea7
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
@@ -0,0 +1,489 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class money_put<charT, OutputIterator>
+
+// iter_type put(iter_type s, bool intl, ios_base& f, char_type fill,
+//               long double units) const;
+
+#include <locale>
+#include <ios>
+#include <streambuf>
+#include <cassert>
+#include "iterators.h"
+
+typedef std::money_put<char, output_iterator<char*> > Fn;
+
+class my_facet
+    : public Fn
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : Fn(refs) {}
+};
+
+typedef std::money_put<wchar_t, output_iterator<wchar_t*> > Fw;
+
+class my_facetw
+    : public Fw
+{
+public:
+    explicit my_facetw(std::size_t refs = 0)
+        : Fw(refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::string loc_name("fr_FR");
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<char, false>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<char, true>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<wchar_t, false>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<wchar_t, true>(loc_name)));
+{
+    const my_facet f(1);
+    // char, national
+    {   // zero
+        long double v = 0;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0,00 ");
+    }
+    {   // negative one
+        long double v = -1;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0,01 -");
+    }
+    {   // positive
+        long double v = 123456789;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1 234 567,89 ");
+    }
+    {   // negative
+        long double v = -123456789;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1 234 567,89 -");
+    }
+    {   // zero, showbase
+        long double v = 0;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0,00 Eu");
+    }
+    {   // negative one, showbase
+        long double v = -1;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0,01 Eu-");
+    }
+    {   // positive, showbase
+        long double v = 123456789;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1 234 567,89 Eu");
+    }
+    {   // negative, showbase
+        long double v = -123456789;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1 234 567,89 Eu-");
+    }
+    {   // negative, showbase, left
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        left(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1 234 567,89 Eu-    ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, internal
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        internal(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1 234 567,89     Eu-");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, right
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        right(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "    1 234 567,89 Eu-");
+        assert(ios.width() == 0);
+    }
+
+    // char, international
+    noshowbase(ios);
+    ios.unsetf(std::ios_base::adjustfield);
+    {   // zero
+        long double v = 0;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0,00 ");
+    }
+    {   // negative one
+        long double v = -1;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0,01 -");
+    }
+    {   // positive
+        long double v = 123456789;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1 234 567,89 ");
+    }
+    {   // negative
+        long double v = -123456789;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1 234 567,89 -");
+    }
+    {   // zero, showbase
+        long double v = 0;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0,00 EUR ");
+    }
+    {   // negative one, showbase
+        long double v = -1;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0,01 EUR -");
+    }
+    {   // positive, showbase
+        long double v = 123456789;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1 234 567,89 EUR ");
+    }
+    {   // negative, showbase
+        long double v = -123456789;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1 234 567,89 EUR -");
+    }
+    {   // negative, showbase, left
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        left(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1 234 567,89 EUR -  ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, internal
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        internal(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1 234 567,89   EUR -");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, right
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        right(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "  1 234 567,89 EUR -");
+        assert(ios.width() == 0);
+    }
+}
+{
+    const my_facetw f(1);
+    // wchar_t, national
+    noshowbase(ios);
+    ios.unsetf(std::ios_base::adjustfield);
+    {   // zero
+        long double v = 0;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"0,00 ");
+    }
+    {   // negative one
+        long double v = -1;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"0,01 -");
+    }
+    {   // positive
+        long double v = 123456789;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1 234 567,89 ");
+    }
+    {   // negative
+        long double v = -123456789;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1 234 567,89 -");
+    }
+    {   // zero, showbase
+        long double v = 0;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"0,00 Eu");
+    }
+    {   // negative one, showbase
+        long double v = -1;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"0,01 Eu-");
+    }
+    {   // positive, showbase
+        long double v = 123456789;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1 234 567,89 Eu");
+    }
+    {   // negative, showbase
+        long double v = -123456789;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1 234 567,89 Eu-");
+    }
+    {   // negative, showbase, left
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        left(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1 234 567,89 Eu-    ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, internal
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        internal(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1 234 567,89     Eu-");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, right
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        right(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"    1 234 567,89 Eu-");
+        assert(ios.width() == 0);
+    }
+
+    // wchar_t, international
+    noshowbase(ios);
+    ios.unsetf(std::ios_base::adjustfield);
+    {   // zero
+        long double v = 0;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"0,00 ");
+    }
+    {   // negative one
+        long double v = -1;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"0,01 -");
+    }
+    {   // positive
+        long double v = 123456789;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1 234 567,89 ");
+    }
+    {   // negative
+        long double v = -123456789;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1 234 567,89 -");
+    }
+    {   // zero, showbase
+        long double v = 0;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"0,00 EUR ");
+    }
+    {   // negative one, showbase
+        long double v = -1;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"0,01 EUR -");
+    }
+    {   // positive, showbase
+        long double v = 123456789;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1 234 567,89 EUR ");
+    }
+    {   // negative, showbase
+        long double v = -123456789;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1 234 567,89 EUR -");
+    }
+    {   // negative, showbase, left
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        left(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1 234 567,89 EUR -  ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, internal
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        internal(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1 234 567,89   EUR -");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, right
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        right(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"  1 234 567,89 EUR -");
+        assert(ios.width() == 0);
+    }
+}
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp
new file mode 100644
index 0000000..c0baf22
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp
@@ -0,0 +1,489 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class money_put<charT, OutputIterator>
+
+// iter_type put(iter_type s, bool intl, ios_base& f, char_type fill,
+//               long double units) const;
+
+#include <locale>
+#include <ios>
+#include <streambuf>
+#include <cassert>
+#include "iterators.h"
+
+typedef std::money_put<char, output_iterator<char*> > Fn;
+
+class my_facet
+    : public Fn
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : Fn(refs) {}
+};
+
+typedef std::money_put<wchar_t, output_iterator<wchar_t*> > Fw;
+
+class my_facetw
+    : public Fw
+{
+public:
+    explicit my_facetw(std::size_t refs = 0)
+        : Fw(refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::string loc_name("ru_RU");
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<char, false>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<char, true>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<wchar_t, false>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<wchar_t, true>(loc_name)));
+{
+    const my_facet f(1);
+    // char, national
+    {   // zero
+        long double v = 0;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0,00 ");
+    }
+    {   // negative one
+        long double v = -1;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-0,01 ");
+    }
+    {   // positive
+        long double v = 123456789;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1 234 567,89 ");
+    }
+    {   // negative
+        long double v = -123456789;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1 234 567,89 ");
+    }
+    {   // zero, showbase
+        long double v = 0;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0,00 \xD1\x80\xD1\x83\xD0\xB1"".");
+    }
+    {   // negative one, showbase
+        long double v = -1;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-0,01 \xD1\x80\xD1\x83\xD0\xB1"".");
+    }
+    {   // positive, showbase
+        long double v = 123456789;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1 234 567,89 \xD1\x80\xD1\x83\xD0\xB1"".");
+    }
+    {   // negative, showbase
+        long double v = -123456789;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1 234 567,89 \xD1\x80\xD1\x83\xD0\xB1"".");
+    }
+    {   // negative, showbase, left
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        left(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1 234 567,89 \xD1\x80\xD1\x83\xD0\xB1"".");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, internal
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        internal(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1 234 567,89 \xD1\x80\xD1\x83\xD0\xB1"".");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, right
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        right(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1 234 567,89 \xD1\x80\xD1\x83\xD0\xB1"".");
+        assert(ios.width() == 0);
+    }
+
+    // char, international
+    noshowbase(ios);
+    ios.unsetf(std::ios_base::adjustfield);
+    {   // zero
+        long double v = 0;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0,00 ");
+    }
+    {   // negative one
+        long double v = -1;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-0,01 ");
+    }
+    {   // positive
+        long double v = 123456789;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1 234 567,89 ");
+    }
+    {   // negative
+        long double v = -123456789;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1 234 567,89 ");
+    }
+    {   // zero, showbase
+        long double v = 0;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0,00 RUR ");
+    }
+    {   // negative one, showbase
+        long double v = -1;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-0,01 RUR ");
+    }
+    {   // positive, showbase
+        long double v = 123456789;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1 234 567,89 RUR ");
+    }
+    {   // negative, showbase
+        long double v = -123456789;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1 234 567,89 RUR ");
+    }
+    {   // negative, showbase, left
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        left(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1 234 567,89 RUR   ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, internal
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        internal(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1 234 567,89   RUR ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, right
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        right(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "  -1 234 567,89 RUR ");
+        assert(ios.width() == 0);
+    }
+}
+{
+    const my_facetw f(1);
+    // wchar_t, national
+    noshowbase(ios);
+    ios.unsetf(std::ios_base::adjustfield);
+    {   // zero
+        long double v = 0;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"0,00 ");
+    }
+    {   // negative one
+        long double v = -1;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-0,01 ");
+    }
+    {   // positive
+        long double v = 123456789;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1 234 567,89 ");
+    }
+    {   // negative
+        long double v = -123456789;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-1 234 567,89 ");
+    }
+    {   // zero, showbase
+        long double v = 0;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"0,00 \x440\x443\x431"".");
+    }
+    {   // negative one, showbase
+        long double v = -1;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-0,01 \x440\x443\x431"".");
+    }
+    {   // positive, showbase
+        long double v = 123456789;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1 234 567,89 \x440\x443\x431"".");
+    }
+    {   // negative, showbase
+        long double v = -123456789;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-1 234 567,89 \x440\x443\x431"".");
+    }
+    {   // negative, showbase, left
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        left(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-1 234 567,89 \x440\x443\x431"".  ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, internal
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        internal(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-1 234 567,89   \x440\x443\x431"".");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, right
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        right(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"  -1 234 567,89 \x440\x443\x431"".");
+        assert(ios.width() == 0);
+    }
+
+    // wchar_t, international
+    noshowbase(ios);
+    ios.unsetf(std::ios_base::adjustfield);
+    {   // zero
+        long double v = 0;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"0,00 ");
+    }
+    {   // negative one
+        long double v = -1;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-0,01 ");
+    }
+    {   // positive
+        long double v = 123456789;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1 234 567,89 ");
+    }
+    {   // negative
+        long double v = -123456789;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-1 234 567,89 ");
+    }
+    {   // zero, showbase
+        long double v = 0;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"0,00 RUR ");
+    }
+    {   // negative one, showbase
+        long double v = -1;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-0,01 RUR ");
+    }
+    {   // positive, showbase
+        long double v = 123456789;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1 234 567,89 RUR ");
+    }
+    {   // negative, showbase
+        long double v = -123456789;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-1 234 567,89 RUR ");
+    }
+    {   // negative, showbase, left
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        left(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-1 234 567,89 RUR   ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, internal
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        internal(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-1 234 567,89   RUR ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, right
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        right(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"  -1 234 567,89 RUR ");
+        assert(ios.width() == 0);
+    }
+}
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp
new file mode 100644
index 0000000..80ab190
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp
@@ -0,0 +1,489 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class money_put<charT, OutputIterator>
+
+// iter_type put(iter_type s, bool intl, ios_base& f, char_type fill,
+//               long double units) const;
+
+#include <locale>
+#include <ios>
+#include <streambuf>
+#include <cassert>
+#include "iterators.h"
+
+typedef std::money_put<char, output_iterator<char*> > Fn;
+
+class my_facet
+    : public Fn
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : Fn(refs) {}
+};
+
+typedef std::money_put<wchar_t, output_iterator<wchar_t*> > Fw;
+
+class my_facetw
+    : public Fw
+{
+public:
+    explicit my_facetw(std::size_t refs = 0)
+        : Fw(refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::string loc_name("zh_CN");
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<char, false>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<char, true>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<wchar_t, false>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<wchar_t, true>(loc_name)));
+{
+    const my_facet f(1);
+    // char, national
+    {   // zero
+        long double v = 0;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0.00");
+    }
+    {   // negative one
+        long double v = -1;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-0.01");
+    }
+    {   // positive
+        long double v = 123456789;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1,234,567.89");
+    }
+    {   // negative
+        long double v = -123456789;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1,234,567.89");
+    }
+    {   // zero, showbase
+        long double v = 0;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "\xEF\xBF\xA5""0.00");
+    }
+    {   // negative one, showbase
+        long double v = -1;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "\xEF\xBF\xA5""-0.01");
+    }
+    {   // positive, showbase
+        long double v = 123456789;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "\xEF\xBF\xA5""1,234,567.89");
+    }
+    {   // negative, showbase
+        long double v = -123456789;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "\xEF\xBF\xA5""-1,234,567.89");
+    }
+    {   // negative, showbase, left
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        left(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "\xEF\xBF\xA5""-1,234,567.89    ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, internal
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        internal(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "\xEF\xBF\xA5""-    1,234,567.89");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, right
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        right(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "    \xEF\xBF\xA5""-1,234,567.89");
+        assert(ios.width() == 0);
+    }
+
+    // char, international
+    noshowbase(ios);
+    ios.unsetf(std::ios_base::adjustfield);
+    {   // zero
+        long double v = 0;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0.00");
+    }
+    {   // negative one
+        long double v = -1;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-0.01");
+    }
+    {   // positive
+        long double v = 123456789;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1,234,567.89");
+    }
+    {   // negative
+        long double v = -123456789;
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1,234,567.89");
+    }
+    {   // zero, showbase
+        long double v = 0;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "CNY 0.00");
+    }
+    {   // negative one, showbase
+        long double v = -1;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "CNY -0.01");
+    }
+    {   // positive, showbase
+        long double v = 123456789;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "CNY 1,234,567.89");
+    }
+    {   // negative, showbase
+        long double v = -123456789;
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "CNY -1,234,567.89");
+    }
+    {   // negative, showbase, left
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        left(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "CNY -1,234,567.89   ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, internal
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        internal(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "CNY -   1,234,567.89");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, right
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        right(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "   CNY -1,234,567.89");
+        assert(ios.width() == 0);
+    }
+}
+{
+    const my_facetw f(1);
+    // wchar_t, national
+    noshowbase(ios);
+    ios.unsetf(std::ios_base::adjustfield);
+    {   // zero
+        long double v = 0;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"0.00");
+    }
+    {   // negative one
+        long double v = -1;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-0.01");
+    }
+    {   // positive
+        long double v = 123456789;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1,234,567.89");
+    }
+    {   // negative
+        long double v = -123456789;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-1,234,567.89");
+    }
+    {   // zero, showbase
+        long double v = 0;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"\xFFE5""0.00");
+    }
+    {   // negative one, showbase
+        long double v = -1;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"\xFFE5""-0.01");
+    }
+    {   // positive, showbase
+        long double v = 123456789;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"\xFFE5""1,234,567.89");
+    }
+    {   // negative, showbase
+        long double v = -123456789;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"\xFFE5""-1,234,567.89");
+    }
+    {   // negative, showbase, left
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        left(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"\xFFE5""-1,234,567.89      ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, internal
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        internal(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"\xFFE5""-      1,234,567.89");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, right
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        right(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"      \xFFE5""-1,234,567.89");
+        assert(ios.width() == 0);
+    }
+
+    // wchar_t, international
+    noshowbase(ios);
+    ios.unsetf(std::ios_base::adjustfield);
+    {   // zero
+        long double v = 0;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"0.00");
+    }
+    {   // negative one
+        long double v = -1;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-0.01");
+    }
+    {   // positive
+        long double v = 123456789;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1,234,567.89");
+    }
+    {   // negative
+        long double v = -123456789;
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-1,234,567.89");
+    }
+    {   // zero, showbase
+        long double v = 0;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"CNY 0.00");
+    }
+    {   // negative one, showbase
+        long double v = -1;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"CNY -0.01");
+    }
+    {   // positive, showbase
+        long double v = 123456789;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"CNY 1,234,567.89");
+    }
+    {   // negative, showbase
+        long double v = -123456789;
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"CNY -1,234,567.89");
+    }
+    {   // negative, showbase, left
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        left(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"CNY -1,234,567.89   ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, internal
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        internal(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"CNY -   1,234,567.89");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, right
+        long double v = -123456789;
+        showbase(ios);
+        ios.width(20);
+        right(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"   CNY -1,234,567.89");
+        assert(ios.width() == 0);
+    }
+}
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp
new file mode 100644
index 0000000..b3ce42c
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp
@@ -0,0 +1,490 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class money_put<charT, OutputIterator>
+
+// iter_type put(iter_type s, bool intl, ios_base& f, char_type fill,
+//               const string_type& units) const;
+
+#include <locale>
+#include <ios>
+#include <streambuf>
+#include <cassert>
+#include "iterators.h"
+
+typedef std::money_put<char, output_iterator<char*> > Fn;
+
+class my_facet
+    : public Fn
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : Fn(refs) {}
+};
+
+typedef std::money_put<wchar_t, output_iterator<wchar_t*> > Fw;
+
+class my_facetw
+    : public Fw
+{
+public:
+    explicit my_facetw(std::size_t refs = 0)
+        : Fw(refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::string loc_name("en_US");
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<char, false>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<char, true>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<wchar_t, false>(loc_name)));
+    ios.imbue(std::locale(ios.getloc(),
+                          new std::moneypunct_byname<wchar_t, true>(loc_name)));
+{
+    const my_facet f(1);
+    // char, national
+    {   // zero
+        std::string v = "0";
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0.00");
+    }
+    {   // negative one
+        std::string v = "-1";
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-0.01");
+    }
+    {   // positive
+        std::string v = "123456789";
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1,234,567.89");
+    }
+    {   // negative
+        std::string v = "-123456789";
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1,234,567.89");
+    }
+    {   // zero, showbase
+        std::string v = "0";
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "$0.00");
+    }
+    {   // negative one, showbase
+        std::string v = "-1";
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-$0.01");
+    }
+    {   // positive, showbase
+        std::string v = "123456789";
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "$1,234,567.89");
+    }
+    {   // negative, showbase
+        std::string v = "-123456789";
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-$1,234,567.89");
+    }
+    {   // negative, showbase, left
+        std::string v = "-123456789";
+        showbase(ios);
+        ios.width(20);
+        left(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-$1,234,567.89      ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, internal
+        std::string v = "-123456789";
+        showbase(ios);
+        ios.width(20);
+        internal(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-$      1,234,567.89");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, right
+        std::string v = "-123456789";
+        showbase(ios);
+        ios.width(20);
+        right(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            false, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "      -$1,234,567.89");
+        assert(ios.width() == 0);
+    }
+
+    // char, international
+    noshowbase(ios);
+    ios.unsetf(std::ios_base::adjustfield);
+    {   // zero
+        std::string v = "0";
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0.00");
+    }
+    {   // negative one
+        std::string v = "-1";
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-0.01");
+    }
+    {   // positive
+        std::string v = "123456789";
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1,234,567.89");
+    }
+    {   // negative
+        std::string v = "-123456789";
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1,234,567.89");
+    }
+    {   // zero, showbase
+        std::string v = "0";
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "USD 0.00");
+    }
+    {   // negative one, showbase
+        std::string v = "-1";
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-USD 0.01");
+    }
+    {   // positive, showbase
+        std::string v = "123456789";
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "USD 1,234,567.89");
+    }
+    {   // negative, showbase
+        std::string v = "-123456789";
+        showbase(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-USD 1,234,567.89");
+    }
+    {   // negative, showbase, left
+        std::string v = "-123456789";
+        showbase(ios);
+        ios.width(20);
+        left(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-USD 1,234,567.89   ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, internal
+        std::string v = "-123456789";
+        showbase(ios);
+        ios.width(20);
+        internal(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-USD    1,234,567.89");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, right
+        std::string v = "-123456789";
+        showbase(ios);
+        ios.width(20);
+        right(ios);
+        char str[100];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str),
+                                            true, ios, ' ', v);
+        std::string ex(str, iter.base());
+        assert(ex == "   -USD 1,234,567.89");
+        assert(ios.width() == 0);
+    }
+}
+{
+
+    const my_facetw f(1);
+    // wchar_t, national
+    noshowbase(ios);
+    ios.unsetf(std::ios_base::adjustfield);
+    {   // zero
+        std::wstring v = L"0";
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"0.00");
+    }
+    {   // negative one
+        std::wstring v = L"-1";
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-0.01");
+    }
+    {   // positive
+        std::wstring v = L"123456789";
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1,234,567.89");
+    }
+    {   // negative
+        std::wstring v = L"-123456789";
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-1,234,567.89");
+    }
+    {   // zero, showbase
+        std::wstring v = L"0";
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"$0.00");
+    }
+    {   // negative one, showbase
+        std::wstring v = L"-1";
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-$0.01");
+    }
+    {   // positive, showbase
+        std::wstring v = L"123456789";
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"$1,234,567.89");
+    }
+    {   // negative, showbase
+        std::wstring v = L"-123456789";
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-$1,234,567.89");
+    }
+    {   // negative, showbase, left
+        std::wstring v = L"-123456789";
+        showbase(ios);
+        ios.width(20);
+        left(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-$1,234,567.89      ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, internal
+        std::wstring v = L"-123456789";
+        showbase(ios);
+        ios.width(20);
+        internal(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-$      1,234,567.89");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, right
+        std::wstring v = L"-123456789";
+        showbase(ios);
+        ios.width(20);
+        right(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            false, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"      -$1,234,567.89");
+        assert(ios.width() == 0);
+    }
+
+    // wchar_t, international
+    noshowbase(ios);
+    ios.unsetf(std::ios_base::adjustfield);
+    {   // zero
+        std::wstring v = L"0";
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"0.00");
+    }
+    {   // negative one
+        std::wstring v = L"-1";
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-0.01");
+    }
+    {   // positive
+        std::wstring v = L"123456789";
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"1,234,567.89");
+    }
+    {   // negative
+        std::wstring v = L"-123456789";
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-1,234,567.89");
+    }
+    {   // zero, showbase
+        std::wstring v = L"0";
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"USD 0.00");
+    }
+    {   // negative one, showbase
+        std::wstring v = L"-1";
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-USD 0.01");
+    }
+    {   // positive, showbase
+        std::wstring v = L"123456789";
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"USD 1,234,567.89");
+    }
+    {   // negative, showbase
+        std::wstring v = L"-123456789";
+        showbase(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, '*', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-USD 1,234,567.89");
+    }
+    {   // negative, showbase, left
+        std::wstring v = L"-123456789";
+        showbase(ios);
+        ios.width(20);
+        left(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-USD 1,234,567.89   ");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, internal
+        std::wstring v = L"-123456789";
+        showbase(ios);
+        ios.width(20);
+        internal(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"-USD    1,234,567.89");
+        assert(ios.width() == 0);
+    }
+    {   // negative, showbase, right
+        std::wstring v = L"-123456789";
+        showbase(ios);
+        ios.width(20);
+        right(ios);
+        wchar_t str[100];
+        output_iterator<wchar_t*> iter = f.put(output_iterator<wchar_t*>(str),
+                                            true, ios, ' ', v);
+        std::wstring ex(str, iter.base());
+        assert(ex == L"   -USD 1,234,567.89");
+        assert(ios.width() == 0);
+    }
+}
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.virtuals/tested_elsewhere.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.virtuals/tested_elsewhere.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.virtuals/tested_elsewhere.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.money.put/types.pass.cpp b/test/localization/locale.categories/category.monetary/locale.money.put/types.pass.cpp
new file mode 100644
index 0000000..aee4931
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.money.put/types.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class CharT, class OutputIterator = ostreambuf_iterator<CharT> >
+// class money_put
+//     : public locale::facet
+// {
+// public:
+//     typedef CharT                   char_type;
+//     typedef OutputIterator          iter_type;
+//     typedef basic_string<char_type> string_type;
+
+#include <locale>
+#include <type_traits>
+
+int main()
+{
+    static_assert((std::is_base_of<std::locale::facet, std::money_put<char> >::value), "");
+    static_assert((std::is_base_of<std::locale::facet, std::money_put<wchar_t> >::value), "");
+    static_assert((std::is_same<std::money_put<char>::char_type, char>::value), "");
+    static_assert((std::is_same<std::money_put<wchar_t>::char_type, wchar_t>::value), "");
+    static_assert((std::is_same<std::money_put<char>::iter_type, std::ostreambuf_iterator<char> >::value), "");
+    static_assert((std::is_same<std::money_put<wchar_t>::iter_type, std::ostreambuf_iterator<wchar_t> >::value), "");
+    static_assert((std::is_same<std::money_put<char>::string_type, std::string>::value), "");
+    static_assert((std::is_same<std::money_put<wchar_t>::string_type, std::wstring>::value), "");
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
new file mode 100644
index 0000000..6e5478e
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
@@ -0,0 +1,138 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class moneypunct_byname<charT, International>
+
+// string_type curr_symbol() const;
+
+#include <locale>
+#include <limits>
+#include <cassert>
+
+class Fnf
+    : public std::moneypunct_byname<char, false>
+{
+public:
+    explicit Fnf(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<char, false>(nm, refs) {}
+};
+
+class Fnt
+    : public std::moneypunct_byname<char, true>
+{
+public:
+    explicit Fnt(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<char, true>(nm, refs) {}
+};
+
+class Fwf
+    : public std::moneypunct_byname<wchar_t, false>
+{
+public:
+    explicit Fwf(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<wchar_t, false>(nm, refs) {}
+};
+
+class Fwt
+    : public std::moneypunct_byname<wchar_t, true>
+{
+public:
+    explicit Fwt(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<wchar_t, true>(nm, refs) {}
+};
+
+int main()
+{
+    {
+        Fnf f("C", 1);
+        assert(f.curr_symbol() == std::string());
+    }
+    {
+        Fnt f("C", 1);
+        assert(f.curr_symbol() == std::string());
+    }
+    {
+        Fwf f("C", 1);
+        assert(f.curr_symbol() == std::wstring());
+    }
+    {
+        Fwt f("C", 1);
+        assert(f.curr_symbol() == std::wstring());
+    }
+
+    {
+        Fnf f("en_US", 1);
+        assert(f.curr_symbol() == "$");
+    }
+    {
+        Fnt f("en_US", 1);
+        assert(f.curr_symbol() == "USD ");
+    }
+    {
+        Fwf f("en_US", 1);
+        assert(f.curr_symbol() == L"$");
+    }
+    {
+        Fwt f("en_US", 1);
+        assert(f.curr_symbol() == L"USD ");
+    }
+
+    {
+        Fnf f("fr_FR", 1);
+        assert(f.curr_symbol() == "Eu");
+    }
+    {
+        Fnt f("fr_FR", 1);
+        assert(f.curr_symbol() == "EUR ");
+    }
+    {
+        Fwf f("fr_FR", 1);
+        assert(f.curr_symbol() == L"Eu");
+    }
+    {
+        Fwt f("fr_FR", 1);
+        assert(f.curr_symbol() == L"EUR ");
+    }
+
+    {
+        Fnf f("ru_RU", 1);
+        assert(f.curr_symbol() == "\xD1\x80\xD1\x83\xD0\xB1"".");
+    }
+    {
+        Fnt f("ru_RU", 1);
+        assert(f.curr_symbol() == "RUR ");
+    }
+    {
+        Fwf f("ru_RU", 1);
+        assert(f.curr_symbol() == L"\x440\x443\x431"".");
+    }
+    {
+        Fwt f("ru_RU", 1);
+        assert(f.curr_symbol() == L"RUR ");
+    }
+
+    {
+        Fnf f("zh_CN", 1);
+        assert(f.curr_symbol() == "\xEF\xBF\xA5");
+    }
+    {
+        Fnt f("zh_CN", 1);
+        assert(f.curr_symbol() == "CNY ");
+    }
+    {
+        Fwf f("zh_CN", 1);
+        assert(f.curr_symbol() == L"\xFFE5");
+    }
+    {
+        Fwt f("zh_CN", 1);
+        assert(f.curr_symbol() == L"CNY ");
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp
new file mode 100644
index 0000000..c6e3426
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp
@@ -0,0 +1,138 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class moneypunct_byname<charT, International>
+
+// charT decimal_point() const;
+
+#include <locale>
+#include <limits>
+#include <cassert>
+
+class Fnf
+    : public std::moneypunct_byname<char, false>
+{
+public:
+    explicit Fnf(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<char, false>(nm, refs) {}
+};
+
+class Fnt
+    : public std::moneypunct_byname<char, true>
+{
+public:
+    explicit Fnt(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<char, true>(nm, refs) {}
+};
+
+class Fwf
+    : public std::moneypunct_byname<wchar_t, false>
+{
+public:
+    explicit Fwf(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<wchar_t, false>(nm, refs) {}
+};
+
+class Fwt
+    : public std::moneypunct_byname<wchar_t, true>
+{
+public:
+    explicit Fwt(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<wchar_t, true>(nm, refs) {}
+};
+
+int main()
+{
+    {
+        Fnf f("C", 1);
+        assert(f.decimal_point() == std::numeric_limits<char>::max());
+    }
+    {
+        Fnt f("C", 1);
+        assert(f.decimal_point() == std::numeric_limits<char>::max());
+    }
+    {
+        Fwf f("C", 1);
+        assert(f.decimal_point() == std::numeric_limits<wchar_t>::max());
+    }
+    {
+        Fwt f("C", 1);
+        assert(f.decimal_point() == std::numeric_limits<wchar_t>::max());
+    }
+
+    {
+        Fnf f("en_US", 1);
+        assert(f.decimal_point() == '.');
+    }
+    {
+        Fnt f("en_US", 1);
+        assert(f.decimal_point() == '.');
+    }
+    {
+        Fwf f("en_US", 1);
+        assert(f.decimal_point() == L'.');
+    }
+    {
+        Fwt f("en_US", 1);
+        assert(f.decimal_point() == L'.');
+    }
+
+    {
+        Fnf f("fr_FR", 1);
+        assert(f.decimal_point() == ',');
+    }
+    {
+        Fnt f("fr_FR", 1);
+        assert(f.decimal_point() == ',');
+    }
+    {
+        Fwf f("fr_FR", 1);
+        assert(f.decimal_point() == L',');
+    }
+    {
+        Fwt f("fr_FR", 1);
+        assert(f.decimal_point() == L',');
+    }
+
+    {
+        Fnf f("ru_RU", 1);
+        assert(f.decimal_point() == ',');
+    }
+    {
+        Fnt f("ru_RU", 1);
+        assert(f.decimal_point() == ',');
+    }
+    {
+        Fwf f("ru_RU", 1);
+        assert(f.decimal_point() == L',');
+    }
+    {
+        Fwt f("ru_RU", 1);
+        assert(f.decimal_point() == L',');
+    }
+
+    {
+        Fnf f("zh_CN", 1);
+        assert(f.decimal_point() == '.');
+    }
+    {
+        Fnt f("zh_CN", 1);
+        assert(f.decimal_point() == '.');
+    }
+    {
+        Fwf f("zh_CN", 1);
+        assert(f.decimal_point() == L'.');
+    }
+    {
+        Fwt f("zh_CN", 1);
+        assert(f.decimal_point() == L'.');
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/frac_digits.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/frac_digits.pass.cpp
new file mode 100644
index 0000000..87ed709
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/frac_digits.pass.cpp
@@ -0,0 +1,138 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class moneypunct_byname<charT, International>
+
+// int frac_digits() const;
+
+#include <locale>
+#include <limits>
+#include <cassert>
+
+class Fnf
+    : public std::moneypunct_byname<char, false>
+{
+public:
+    explicit Fnf(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<char, false>(nm, refs) {}
+};
+
+class Fnt
+    : public std::moneypunct_byname<char, true>
+{
+public:
+    explicit Fnt(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<char, true>(nm, refs) {}
+};
+
+class Fwf
+    : public std::moneypunct_byname<wchar_t, false>
+{
+public:
+    explicit Fwf(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<wchar_t, false>(nm, refs) {}
+};
+
+class Fwt
+    : public std::moneypunct_byname<wchar_t, true>
+{
+public:
+    explicit Fwt(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<wchar_t, true>(nm, refs) {}
+};
+
+int main()
+{
+    {
+        Fnf f("C", 1);
+        assert(f.frac_digits() == 0);
+    }
+    {
+        Fnt f("C", 1);
+        assert(f.frac_digits() == 0);
+    }
+    {
+        Fwf f("C", 1);
+        assert(f.frac_digits() == 0);
+    }
+    {
+        Fwt f("C", 1);
+        assert(f.frac_digits() == 0);
+    }
+
+    {
+        Fnf f("en_US", 1);
+        assert(f.frac_digits() == 2);
+    }
+    {
+        Fnt f("en_US", 1);
+        assert(f.frac_digits() == 2);
+    }
+    {
+        Fwf f("en_US", 1);
+        assert(f.frac_digits() == 2);
+    }
+    {
+        Fwt f("en_US", 1);
+        assert(f.frac_digits() == 2);
+    }
+
+    {
+        Fnf f("fr_FR", 1);
+        assert(f.frac_digits() == 2);
+    }
+    {
+        Fnt f("fr_FR", 1);
+        assert(f.frac_digits() == 2);
+    }
+    {
+        Fwf f("fr_FR", 1);
+        assert(f.frac_digits() == 2);
+    }
+    {
+        Fwt f("fr_FR", 1);
+        assert(f.frac_digits() == 2);
+    }
+
+    {
+        Fnf f("ru_RU", 1);
+        assert(f.frac_digits() == 2);
+    }
+    {
+        Fnt f("ru_RU", 1);
+        assert(f.frac_digits() == 2);
+    }
+    {
+        Fwf f("ru_RU", 1);
+        assert(f.frac_digits() == 2);
+    }
+    {
+        Fwt f("ru_RU", 1);
+        assert(f.frac_digits() == 2);
+    }
+
+    {
+        Fnf f("zh_CN", 1);
+        assert(f.frac_digits() == 2);
+    }
+    {
+        Fnt f("zh_CN", 1);
+        assert(f.frac_digits() == 2);
+    }
+    {
+        Fwf f("zh_CN", 1);
+        assert(f.frac_digits() == 2);
+    }
+    {
+        Fwt f("zh_CN", 1);
+        assert(f.frac_digits() == 2);
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp
new file mode 100644
index 0000000..4cb78b6
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp
@@ -0,0 +1,138 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class moneypunct_byname<charT, International>
+
+// string grouping() const;
+
+#include <locale>
+#include <limits>
+#include <cassert>
+
+class Fnf
+    : public std::moneypunct_byname<char, false>
+{
+public:
+    explicit Fnf(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<char, false>(nm, refs) {}
+};
+
+class Fnt
+    : public std::moneypunct_byname<char, true>
+{
+public:
+    explicit Fnt(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<char, true>(nm, refs) {}
+};
+
+class Fwf
+    : public std::moneypunct_byname<wchar_t, false>
+{
+public:
+    explicit Fwf(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<wchar_t, false>(nm, refs) {}
+};
+
+class Fwt
+    : public std::moneypunct_byname<wchar_t, true>
+{
+public:
+    explicit Fwt(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<wchar_t, true>(nm, refs) {}
+};
+
+int main()
+{
+    {
+        Fnf f("C", 1);
+        assert(f.grouping() == "");
+    }
+    {
+        Fnt f("C", 1);
+        assert(f.grouping() == "");
+    }
+    {
+        Fwf f("C", 1);
+        assert(f.grouping() == "");
+    }
+    {
+        Fwt f("C", 1);
+        assert(f.grouping() == "");
+    }
+
+    {
+        Fnf f("en_US", 1);
+        assert(f.grouping() == "\3\3");
+    }
+    {
+        Fnt f("en_US", 1);
+        assert(f.grouping() == "\3\3");
+    }
+    {
+        Fwf f("en_US", 1);
+        assert(f.grouping() == "\3\3");
+    }
+    {
+        Fwt f("en_US", 1);
+        assert(f.grouping() == "\3\3");
+    }
+
+    {
+        Fnf f("fr_FR", 1);
+        assert(f.grouping() == "\3\3");
+    }
+    {
+        Fnt f("fr_FR", 1);
+        assert(f.grouping() == "\3\3");
+    }
+    {
+        Fwf f("fr_FR", 1);
+        assert(f.grouping() == "\3\3");
+    }
+    {
+        Fwt f("fr_FR", 1);
+        assert(f.grouping() == "\3\3");
+    }
+
+    {
+        Fnf f("ru_RU", 1);
+        assert(f.grouping() == "\3\3");
+    }
+    {
+        Fnt f("ru_RU", 1);
+        assert(f.grouping() == "\3\3");
+    }
+    {
+        Fwf f("ru_RU", 1);
+        assert(f.grouping() == "\3\3");
+    }
+    {
+        Fwt f("ru_RU", 1);
+        assert(f.grouping() == "\3\3");
+    }
+
+    {
+        Fnf f("zh_CN", 1);
+        assert(f.grouping() == "\3\3");
+    }
+    {
+        Fnt f("zh_CN", 1);
+        assert(f.grouping() == "\3\3");
+    }
+    {
+        Fwf f("zh_CN", 1);
+        assert(f.grouping() == "\3\3");
+    }
+    {
+        Fwt f("zh_CN", 1);
+        assert(f.grouping() == "\3\3");
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp
new file mode 100644
index 0000000..6360f19
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp
@@ -0,0 +1,218 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class moneypunct_byname<charT, International>
+
+// pattern neg_format() const;
+
+#include <locale>
+#include <limits>
+#include <cassert>
+
+class Fnf
+    : public std::moneypunct_byname<char, false>
+{
+public:
+    explicit Fnf(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<char, false>(nm, refs) {}
+};
+
+class Fnt
+    : public std::moneypunct_byname<char, true>
+{
+public:
+    explicit Fnt(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<char, true>(nm, refs) {}
+};
+
+class Fwf
+    : public std::moneypunct_byname<wchar_t, false>
+{
+public:
+    explicit Fwf(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<wchar_t, false>(nm, refs) {}
+};
+
+class Fwt
+    : public std::moneypunct_byname<wchar_t, true>
+{
+public:
+    explicit Fwt(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<wchar_t, true>(nm, refs) {}
+};
+
+int main()
+{
+    {
+        Fnf f("C", 1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::symbol);
+        assert(p.field[1] == std::money_base::sign);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fnt f("C", 1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::symbol);
+        assert(p.field[1] == std::money_base::sign);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fwf f("C", 1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::symbol);
+        assert(p.field[1] == std::money_base::sign);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fwt f("C", 1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::symbol);
+        assert(p.field[1] == std::money_base::sign);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+
+    {
+        Fnf f("en_US", 1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::symbol);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fnt f("en_US", 1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::symbol);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fwf f("en_US", 1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::symbol);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fwt f("en_US", 1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::symbol);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+
+    {
+        Fnf f("fr_FR", 1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::value);
+        assert(p.field[1] == std::money_base::space);
+        assert(p.field[2] == std::money_base::symbol);
+        assert(p.field[3] == std::money_base::sign);
+    }
+    {
+        Fnt f("fr_FR", 1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::value);
+        assert(p.field[1] == std::money_base::space);
+        assert(p.field[2] == std::money_base::symbol);
+        assert(p.field[3] == std::money_base::sign);
+    }
+    {
+        Fwf f("fr_FR", 1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::value);
+        assert(p.field[1] == std::money_base::space);
+        assert(p.field[2] == std::money_base::symbol);
+        assert(p.field[3] == std::money_base::sign);
+    }
+    {
+        Fwt f("fr_FR", 1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::value);
+        assert(p.field[1] == std::money_base::space);
+        assert(p.field[2] == std::money_base::symbol);
+        assert(p.field[3] == std::money_base::sign);
+    }
+
+    {
+        Fnf f("ru_RU", 1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::value);
+        assert(p.field[2] == std::money_base::space);
+        assert(p.field[3] == std::money_base::symbol);
+    }
+    {
+        Fnt f("ru_RU", 1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::value);
+        assert(p.field[2] == std::money_base::space);
+        assert(p.field[3] == std::money_base::symbol);
+    }
+    {
+        Fwf f("ru_RU", 1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::value);
+        assert(p.field[2] == std::money_base::space);
+        assert(p.field[3] == std::money_base::symbol);
+    }
+    {
+        Fwt f("ru_RU", 1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::value);
+        assert(p.field[2] == std::money_base::space);
+        assert(p.field[3] == std::money_base::symbol);
+    }
+
+    {
+        Fnf f("zh_CN", 1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::symbol);
+        assert(p.field[1] == std::money_base::sign);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fnt f("zh_CN", 1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::symbol);
+        assert(p.field[1] == std::money_base::sign);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fwf f("zh_CN", 1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::symbol);
+        assert(p.field[1] == std::money_base::sign);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fwt f("zh_CN", 1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::symbol);
+        assert(p.field[1] == std::money_base::sign);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp
new file mode 100644
index 0000000..da4afcd
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp
@@ -0,0 +1,138 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class moneypunct_byname<charT, International>
+
+// string_type negative_sign() const;
+
+#include <locale>
+#include <limits>
+#include <cassert>
+
+class Fnf
+    : public std::moneypunct_byname<char, false>
+{
+public:
+    explicit Fnf(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<char, false>(nm, refs) {}
+};
+
+class Fnt
+    : public std::moneypunct_byname<char, true>
+{
+public:
+    explicit Fnt(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<char, true>(nm, refs) {}
+};
+
+class Fwf
+    : public std::moneypunct_byname<wchar_t, false>
+{
+public:
+    explicit Fwf(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<wchar_t, false>(nm, refs) {}
+};
+
+class Fwt
+    : public std::moneypunct_byname<wchar_t, true>
+{
+public:
+    explicit Fwt(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<wchar_t, true>(nm, refs) {}
+};
+
+int main()
+{
+    {
+        Fnf f("C", 1);
+        assert(f.negative_sign() == std::string());
+    }
+    {
+        Fnt f("C", 1);
+        assert(f.negative_sign() == std::string());
+    }
+    {
+        Fwf f("C", 1);
+        assert(f.negative_sign() == std::wstring());
+    }
+    {
+        Fwt f("C", 1);
+        assert(f.negative_sign() == std::wstring());
+    }
+
+    {
+        Fnf f("en_US", 1);
+        assert(f.negative_sign() == "-");
+    }
+    {
+        Fnt f("en_US", 1);
+        assert(f.negative_sign() == "-");
+    }
+    {
+        Fwf f("en_US", 1);
+        assert(f.negative_sign() == L"-");
+    }
+    {
+        Fwt f("en_US", 1);
+        assert(f.negative_sign() == L"-");
+    }
+
+    {
+        Fnf f("fr_FR", 1);
+        assert(f.negative_sign() == "-");
+    }
+    {
+        Fnt f("fr_FR", 1);
+        assert(f.negative_sign() == "-");
+    }
+    {
+        Fwf f("fr_FR", 1);
+        assert(f.negative_sign() == L"-");
+    }
+    {
+        Fwt f("fr_FR", 1);
+        assert(f.negative_sign() == L"-");
+    }
+
+    {
+        Fnf f("ru_RU", 1);
+        assert(f.negative_sign() == "-");
+    }
+    {
+        Fnt f("ru_RU", 1);
+        assert(f.negative_sign() == "-");
+    }
+    {
+        Fwf f("ru_RU", 1);
+        assert(f.negative_sign() == L"-");
+    }
+    {
+        Fwt f("ru_RU", 1);
+        assert(f.negative_sign() == L"-");
+    }
+
+    {
+        Fnf f("zh_CN", 1);
+        assert(f.negative_sign() == "-");
+    }
+    {
+        Fnt f("zh_CN", 1);
+        assert(f.negative_sign() == "-");
+    }
+    {
+        Fwf f("zh_CN", 1);
+        assert(f.negative_sign() == L"-");
+    }
+    {
+        Fwt f("zh_CN", 1);
+        assert(f.negative_sign() == L"-");
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp
new file mode 100644
index 0000000..3cb5c6c
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp
@@ -0,0 +1,218 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class moneypunct_byname<charT, International>
+
+// pattern pos_format() const;
+
+#include <locale>
+#include <limits>
+#include <cassert>
+
+class Fnf
+    : public std::moneypunct_byname<char, false>
+{
+public:
+    explicit Fnf(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<char, false>(nm, refs) {}
+};
+
+class Fnt
+    : public std::moneypunct_byname<char, true>
+{
+public:
+    explicit Fnt(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<char, true>(nm, refs) {}
+};
+
+class Fwf
+    : public std::moneypunct_byname<wchar_t, false>
+{
+public:
+    explicit Fwf(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<wchar_t, false>(nm, refs) {}
+};
+
+class Fwt
+    : public std::moneypunct_byname<wchar_t, true>
+{
+public:
+    explicit Fwt(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<wchar_t, true>(nm, refs) {}
+};
+
+int main()
+{
+    {
+        Fnf f("C", 1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::symbol);
+        assert(p.field[1] == std::money_base::sign);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fnt f("C", 1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::symbol);
+        assert(p.field[1] == std::money_base::sign);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fwf f("C", 1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::symbol);
+        assert(p.field[1] == std::money_base::sign);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fwt f("C", 1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::symbol);
+        assert(p.field[1] == std::money_base::sign);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+
+    {
+        Fnf f("en_US", 1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::symbol);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fnt f("en_US", 1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::symbol);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fwf f("en_US", 1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::symbol);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fwt f("en_US", 1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::symbol);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+
+    {
+        Fnf f("fr_FR", 1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::value);
+        assert(p.field[2] == std::money_base::space);
+        assert(p.field[3] == std::money_base::symbol);
+    }
+    {
+        Fnt f("fr_FR", 1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::value);
+        assert(p.field[2] == std::money_base::space);
+        assert(p.field[3] == std::money_base::symbol);
+    }
+    {
+        Fwf f("fr_FR", 1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::value);
+        assert(p.field[2] == std::money_base::space);
+        assert(p.field[3] == std::money_base::symbol);
+    }
+    {
+        Fwt f("fr_FR", 1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::value);
+        assert(p.field[2] == std::money_base::space);
+        assert(p.field[3] == std::money_base::symbol);
+    }
+
+    {
+        Fnf f("ru_RU", 1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::value);
+        assert(p.field[2] == std::money_base::space);
+        assert(p.field[3] == std::money_base::symbol);
+    }
+    {
+        Fnt f("ru_RU", 1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::value);
+        assert(p.field[2] == std::money_base::space);
+        assert(p.field[3] == std::money_base::symbol);
+    }
+    {
+        Fwf f("ru_RU", 1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::value);
+        assert(p.field[2] == std::money_base::space);
+        assert(p.field[3] == std::money_base::symbol);
+    }
+    {
+        Fwt f("ru_RU", 1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::value);
+        assert(p.field[2] == std::money_base::space);
+        assert(p.field[3] == std::money_base::symbol);
+    }
+
+    {
+        Fnf f("zh_CN", 1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::symbol);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fnt f("zh_CN", 1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::symbol);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fwf f("zh_CN", 1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::symbol);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fwt f("zh_CN", 1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::sign);
+        assert(p.field[1] == std::money_base::symbol);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/positive_sign.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/positive_sign.pass.cpp
new file mode 100644
index 0000000..516aa92
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/positive_sign.pass.cpp
@@ -0,0 +1,138 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class moneypunct_byname<charT, International>
+
+// string_type positive_sign() const;
+
+#include <locale>
+#include <limits>
+#include <cassert>
+
+class Fnf
+    : public std::moneypunct_byname<char, false>
+{
+public:
+    explicit Fnf(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<char, false>(nm, refs) {}
+};
+
+class Fnt
+    : public std::moneypunct_byname<char, true>
+{
+public:
+    explicit Fnt(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<char, true>(nm, refs) {}
+};
+
+class Fwf
+    : public std::moneypunct_byname<wchar_t, false>
+{
+public:
+    explicit Fwf(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<wchar_t, false>(nm, refs) {}
+};
+
+class Fwt
+    : public std::moneypunct_byname<wchar_t, true>
+{
+public:
+    explicit Fwt(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<wchar_t, true>(nm, refs) {}
+};
+
+int main()
+{
+    {
+        Fnf f("C", 1);
+        assert(f.positive_sign() == std::string());
+    }
+    {
+        Fnt f("C", 1);
+        assert(f.positive_sign() == std::string());
+    }
+    {
+        Fwf f("C", 1);
+        assert(f.positive_sign() == std::wstring());
+    }
+    {
+        Fwt f("C", 1);
+        assert(f.positive_sign() == std::wstring());
+    }
+
+    {
+        Fnf f("en_US", 1);
+        assert(f.positive_sign() == "");
+    }
+    {
+        Fnt f("en_US", 1);
+        assert(f.positive_sign() == "");
+    }
+    {
+        Fwf f("en_US", 1);
+        assert(f.positive_sign() == L"");
+    }
+    {
+        Fwt f("en_US", 1);
+        assert(f.positive_sign() == L"");
+    }
+
+    {
+        Fnf f("fr_FR", 1);
+        assert(f.positive_sign() == "");
+    }
+    {
+        Fnt f("fr_FR", 1);
+        assert(f.positive_sign() == "");
+    }
+    {
+        Fwf f("fr_FR", 1);
+        assert(f.positive_sign() == L"");
+    }
+    {
+        Fwt f("fr_FR", 1);
+        assert(f.positive_sign() == L"");
+    }
+
+    {
+        Fnf f("ru_RU", 1);
+        assert(f.positive_sign() == "");
+    }
+    {
+        Fnt f("ru_RU", 1);
+        assert(f.positive_sign() == "");
+    }
+    {
+        Fwf f("ru_RU", 1);
+        assert(f.positive_sign() == L"");
+    }
+    {
+        Fwt f("ru_RU", 1);
+        assert(f.positive_sign() == L"");
+    }
+
+    {
+        Fnf f("zh_CN", 1);
+        assert(f.positive_sign() == "");
+    }
+    {
+        Fnt f("zh_CN", 1);
+        assert(f.positive_sign() == "");
+    }
+    {
+        Fwf f("zh_CN", 1);
+        assert(f.positive_sign() == L"");
+    }
+    {
+        Fwt f("zh_CN", 1);
+        assert(f.positive_sign() == L"");
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
new file mode 100644
index 0000000..f5ae62d
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
@@ -0,0 +1,138 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class moneypunct_byname<charT, International>
+
+// charT thousands_sep() const;
+
+#include <locale>
+#include <limits>
+#include <cassert>
+
+class Fnf
+    : public std::moneypunct_byname<char, false>
+{
+public:
+    explicit Fnf(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<char, false>(nm, refs) {}
+};
+
+class Fnt
+    : public std::moneypunct_byname<char, true>
+{
+public:
+    explicit Fnt(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<char, true>(nm, refs) {}
+};
+
+class Fwf
+    : public std::moneypunct_byname<wchar_t, false>
+{
+public:
+    explicit Fwf(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<wchar_t, false>(nm, refs) {}
+};
+
+class Fwt
+    : public std::moneypunct_byname<wchar_t, true>
+{
+public:
+    explicit Fwt(const std::string& nm, std::size_t refs = 0)
+        : std::moneypunct_byname<wchar_t, true>(nm, refs) {}
+};
+
+int main()
+{
+    {
+        Fnf f("C", 1);
+        assert(f.thousands_sep() == std::numeric_limits<char>::max());
+    }
+    {
+        Fnt f("C", 1);
+        assert(f.thousands_sep() == std::numeric_limits<char>::max());
+    }
+    {
+        Fwf f("C", 1);
+        assert(f.thousands_sep() == std::numeric_limits<wchar_t>::max());
+    }
+    {
+        Fwt f("C", 1);
+        assert(f.thousands_sep() == std::numeric_limits<wchar_t>::max());
+    }
+
+    {
+        Fnf f("en_US", 1);
+        assert(f.thousands_sep() == ',');
+    }
+    {
+        Fnt f("en_US", 1);
+        assert(f.thousands_sep() == ',');
+    }
+    {
+        Fwf f("en_US", 1);
+        assert(f.thousands_sep() == L',');
+    }
+    {
+        Fwt f("en_US", 1);
+        assert(f.thousands_sep() == L',');
+    }
+
+    {
+        Fnf f("fr_FR", 1);
+        assert(f.thousands_sep() == ' ');
+    }
+    {
+        Fnt f("fr_FR", 1);
+        assert(f.thousands_sep() == ' ');
+    }
+    {
+        Fwf f("fr_FR", 1);
+        assert(f.thousands_sep() == L' ');
+    }
+    {
+        Fwt f("fr_FR", 1);
+        assert(f.thousands_sep() == L' ');
+    }
+
+    {
+        Fnf f("ru_RU", 1);
+        assert(f.thousands_sep() == ' ');
+    }
+    {
+        Fnt f("ru_RU", 1);
+        assert(f.thousands_sep() == ' ');
+    }
+    {
+        Fwf f("ru_RU", 1);
+        assert(f.thousands_sep() == L' ');
+    }
+    {
+        Fwt f("ru_RU", 1);
+        assert(f.thousands_sep() == L' ');
+    }
+
+    {
+        Fnf f("zh_CN", 1);
+        assert(f.thousands_sep() == ',');
+    }
+    {
+        Fnt f("zh_CN", 1);
+        assert(f.thousands_sep() == ',');
+    }
+    {
+        Fwf f("zh_CN", 1);
+        assert(f.thousands_sep() == L',');
+    }
+    {
+        Fwt f("zh_CN", 1);
+        assert(f.thousands_sep() == L',');
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct/ctor.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct/ctor.pass.cpp
new file mode 100644
index 0000000..438933a
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct/ctor.pass.cpp
@@ -0,0 +1,52 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class moneypunct<charT, International>
+
+// explicit moneypunct(size_t refs = 0);
+
+#include <locale>
+#include <cassert>
+
+typedef std::moneypunct<char> F;
+
+class my_facet
+    : public F
+{
+public:
+    static int count;
+
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {++count;}
+
+    ~my_facet() {--count;}
+};
+
+int my_facet::count = 0;
+
+int main()
+{
+    {
+        std::locale l(std::locale::classic(), new my_facet);
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f(1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/curr_symbol.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/curr_symbol.pass.cpp
new file mode 100644
index 0000000..d3e3d59
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/curr_symbol.pass.cpp
@@ -0,0 +1,75 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class moneypunct<charT, International>
+
+// string_type curr_symbol() const;
+
+// The C++ and C standards are silent.
+//   POSIX standard is being followed (as a guideline).
+
+#include <locale>
+#include <limits>
+#include <cassert>
+
+typedef std::moneypunct<char> F;
+
+class Fnf
+    : public std::moneypunct<char, false>
+{
+public:
+    explicit Fnf(std::size_t refs = 0)
+        : std::moneypunct<char, false>(refs) {}
+};
+
+class Fnt
+    : public std::moneypunct<char, true>
+{
+public:
+    explicit Fnt(std::size_t refs = 0)
+        : std::moneypunct<char, true>(refs) {}
+};
+
+class Fwf
+    : public std::moneypunct<wchar_t, false>
+{
+public:
+    explicit Fwf(std::size_t refs = 0)
+        : std::moneypunct<wchar_t, false>(refs) {}
+};
+
+class Fwt
+    : public std::moneypunct<wchar_t, true>
+{
+public:
+    explicit Fwt(std::size_t refs = 0)
+        : std::moneypunct<wchar_t, true>(refs) {}
+};
+
+int main()
+{
+    {
+        Fnf f(1);
+        assert(f.curr_symbol() == std::string());
+    }
+    {
+        Fnt f(1);
+        assert(f.curr_symbol() == std::string());
+    }
+    {
+        Fwf f(1);
+        assert(f.curr_symbol() == std::wstring());
+    }
+    {
+        Fwt f(1);
+        assert(f.curr_symbol() == std::wstring());
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/decimal_point.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/decimal_point.pass.cpp
new file mode 100644
index 0000000..a374894
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/decimal_point.pass.cpp
@@ -0,0 +1,75 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class moneypunct<charT, International>
+
+// charT decimal_point() const;
+
+// The C++ and C standards are silent.
+//   POSIX standard is being followed (as a guideline).
+
+#include <locale>
+#include <limits>
+#include <cassert>
+
+typedef std::moneypunct<char> F;
+
+class Fnf
+    : public std::moneypunct<char, false>
+{
+public:
+    explicit Fnf(std::size_t refs = 0)
+        : std::moneypunct<char, false>(refs) {}
+};
+
+class Fnt
+    : public std::moneypunct<char, true>
+{
+public:
+    explicit Fnt(std::size_t refs = 0)
+        : std::moneypunct<char, true>(refs) {}
+};
+
+class Fwf
+    : public std::moneypunct<wchar_t, false>
+{
+public:
+    explicit Fwf(std::size_t refs = 0)
+        : std::moneypunct<wchar_t, false>(refs) {}
+};
+
+class Fwt
+    : public std::moneypunct<wchar_t, true>
+{
+public:
+    explicit Fwt(std::size_t refs = 0)
+        : std::moneypunct<wchar_t, true>(refs) {}
+};
+
+int main()
+{
+    {
+        Fnf f(1);
+        assert(f.decimal_point() == std::numeric_limits<char>::max());
+    }
+    {
+        Fnt f(1);
+        assert(f.decimal_point() == std::numeric_limits<char>::max());
+    }
+    {
+        Fwf f(1);
+        assert(f.decimal_point() == std::numeric_limits<wchar_t>::max());
+    }
+    {
+        Fwt f(1);
+        assert(f.decimal_point() == std::numeric_limits<wchar_t>::max());
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/frac_digits.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/frac_digits.pass.cpp
new file mode 100644
index 0000000..93404a3
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/frac_digits.pass.cpp
@@ -0,0 +1,75 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class moneypunct<charT, International>
+
+// int frac_digits() const;
+
+// The C++ and C standards are silent.
+//   POSIX standard is being followed (as a guideline).
+
+#include <locale>
+#include <limits>
+#include <cassert>
+
+typedef std::moneypunct<char> F;
+
+class Fnf
+    : public std::moneypunct<char, false>
+{
+public:
+    explicit Fnf(std::size_t refs = 0)
+        : std::moneypunct<char, false>(refs) {}
+};
+
+class Fnt
+    : public std::moneypunct<char, true>
+{
+public:
+    explicit Fnt(std::size_t refs = 0)
+        : std::moneypunct<char, true>(refs) {}
+};
+
+class Fwf
+    : public std::moneypunct<wchar_t, false>
+{
+public:
+    explicit Fwf(std::size_t refs = 0)
+        : std::moneypunct<wchar_t, false>(refs) {}
+};
+
+class Fwt
+    : public std::moneypunct<wchar_t, true>
+{
+public:
+    explicit Fwt(std::size_t refs = 0)
+        : std::moneypunct<wchar_t, true>(refs) {}
+};
+
+int main()
+{
+    {
+        Fnf f(1);
+        assert(f.frac_digits() == 0);
+    }
+    {
+        Fnt f(1);
+        assert(f.frac_digits() == 0);
+    }
+    {
+        Fwf f(1);
+        assert(f.frac_digits() == 0);
+    }
+    {
+        Fwt f(1);
+        assert(f.frac_digits() == 0);
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/grouping.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/grouping.pass.cpp
new file mode 100644
index 0000000..b02492d
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/grouping.pass.cpp
@@ -0,0 +1,75 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class moneypunct<charT, International>
+
+// string grouping() const;
+
+// The C++ and C standards are silent.
+//   POSIX standard is being followed (as a guideline).
+
+#include <locale>
+#include <limits>
+#include <cassert>
+
+typedef std::moneypunct<char> F;
+
+class Fnf
+    : public std::moneypunct<char, false>
+{
+public:
+    explicit Fnf(std::size_t refs = 0)
+        : std::moneypunct<char, false>(refs) {}
+};
+
+class Fnt
+    : public std::moneypunct<char, true>
+{
+public:
+    explicit Fnt(std::size_t refs = 0)
+        : std::moneypunct<char, true>(refs) {}
+};
+
+class Fwf
+    : public std::moneypunct<wchar_t, false>
+{
+public:
+    explicit Fwf(std::size_t refs = 0)
+        : std::moneypunct<wchar_t, false>(refs) {}
+};
+
+class Fwt
+    : public std::moneypunct<wchar_t, true>
+{
+public:
+    explicit Fwt(std::size_t refs = 0)
+        : std::moneypunct<wchar_t, true>(refs) {}
+};
+
+int main()
+{
+    {
+        Fnf f(1);
+        assert(f.grouping() == std::string());
+    }
+    {
+        Fnt f(1);
+        assert(f.grouping() == std::string());
+    }
+    {
+        Fwf f(1);
+        assert(f.grouping() == std::string());
+    }
+    {
+        Fwt f(1);
+        assert(f.grouping() == std::string());
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/neg_format.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/neg_format.pass.cpp
new file mode 100644
index 0000000..16d585f
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/neg_format.pass.cpp
@@ -0,0 +1,88 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class moneypunct<charT, International>
+
+// pattern neg_format() const;
+
+#include <locale>
+#include <limits>
+#include <cassert>
+
+typedef std::moneypunct<char> F;
+
+class Fnf
+    : public std::moneypunct<char, false>
+{
+public:
+    explicit Fnf(std::size_t refs = 0)
+        : std::moneypunct<char, false>(refs) {}
+};
+
+class Fnt
+    : public std::moneypunct<char, true>
+{
+public:
+    explicit Fnt(std::size_t refs = 0)
+        : std::moneypunct<char, true>(refs) {}
+};
+
+class Fwf
+    : public std::moneypunct<wchar_t, false>
+{
+public:
+    explicit Fwf(std::size_t refs = 0)
+        : std::moneypunct<wchar_t, false>(refs) {}
+};
+
+class Fwt
+    : public std::moneypunct<wchar_t, true>
+{
+public:
+    explicit Fwt(std::size_t refs = 0)
+        : std::moneypunct<wchar_t, true>(refs) {}
+};
+
+int main()
+{
+    {
+        Fnf f(1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::symbol);
+        assert(p.field[1] == std::money_base::sign);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fnt f(1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::symbol);
+        assert(p.field[1] == std::money_base::sign);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fwf f(1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::symbol);
+        assert(p.field[1] == std::money_base::sign);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fwt f(1);
+        std::money_base::pattern p = f.neg_format();
+        assert(p.field[0] == std::money_base::symbol);
+        assert(p.field[1] == std::money_base::sign);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/negative_sign.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/negative_sign.pass.cpp
new file mode 100644
index 0000000..da07912
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/negative_sign.pass.cpp
@@ -0,0 +1,76 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class moneypunct<charT, International>
+
+// string_type negative_sign() const;
+
+// The C++ and C standards are silent.
+//   On this one, commen sense is the guideline.
+//   If customers complain, I'll endeavor to minimize customer complaints
+
+#include <locale>
+#include <limits>
+#include <cassert>
+
+typedef std::moneypunct<char> F;
+
+class Fnf
+    : public std::moneypunct<char, false>
+{
+public:
+    explicit Fnf(std::size_t refs = 0)
+        : std::moneypunct<char, false>(refs) {}
+};
+
+class Fnt
+    : public std::moneypunct<char, true>
+{
+public:
+    explicit Fnt(std::size_t refs = 0)
+        : std::moneypunct<char, true>(refs) {}
+};
+
+class Fwf
+    : public std::moneypunct<wchar_t, false>
+{
+public:
+    explicit Fwf(std::size_t refs = 0)
+        : std::moneypunct<wchar_t, false>(refs) {}
+};
+
+class Fwt
+    : public std::moneypunct<wchar_t, true>
+{
+public:
+    explicit Fwt(std::size_t refs = 0)
+        : std::moneypunct<wchar_t, true>(refs) {}
+};
+
+int main()
+{
+    {
+        Fnf f(1);
+        assert(f.negative_sign() == "-");
+    }
+    {
+        Fnt f(1);
+        assert(f.negative_sign() == "-");
+    }
+    {
+        Fwf f(1);
+        assert(f.negative_sign() == L"-");
+    }
+    {
+        Fwt f(1);
+        assert(f.negative_sign() == L"-");
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/pos_format.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/pos_format.pass.cpp
new file mode 100644
index 0000000..849316c
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/pos_format.pass.cpp
@@ -0,0 +1,88 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class moneypunct<charT, International>
+
+// pattern pos_format() const;
+
+#include <locale>
+#include <limits>
+#include <cassert>
+
+typedef std::moneypunct<char> F;
+
+class Fnf
+    : public std::moneypunct<char, false>
+{
+public:
+    explicit Fnf(std::size_t refs = 0)
+        : std::moneypunct<char, false>(refs) {}
+};
+
+class Fnt
+    : public std::moneypunct<char, true>
+{
+public:
+    explicit Fnt(std::size_t refs = 0)
+        : std::moneypunct<char, true>(refs) {}
+};
+
+class Fwf
+    : public std::moneypunct<wchar_t, false>
+{
+public:
+    explicit Fwf(std::size_t refs = 0)
+        : std::moneypunct<wchar_t, false>(refs) {}
+};
+
+class Fwt
+    : public std::moneypunct<wchar_t, true>
+{
+public:
+    explicit Fwt(std::size_t refs = 0)
+        : std::moneypunct<wchar_t, true>(refs) {}
+};
+
+int main()
+{
+    {
+        Fnf f(1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::symbol);
+        assert(p.field[1] == std::money_base::sign);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fnt f(1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::symbol);
+        assert(p.field[1] == std::money_base::sign);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fwf f(1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::symbol);
+        assert(p.field[1] == std::money_base::sign);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+    {
+        Fwt f(1);
+        std::money_base::pattern p = f.pos_format();
+        assert(p.field[0] == std::money_base::symbol);
+        assert(p.field[1] == std::money_base::sign);
+        assert(p.field[2] == std::money_base::none);
+        assert(p.field[3] == std::money_base::value);
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/positive_sign.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/positive_sign.pass.cpp
new file mode 100644
index 0000000..6cec442
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/positive_sign.pass.cpp
@@ -0,0 +1,75 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class moneypunct<charT, International>
+
+// string_type positive_sign() const;
+
+// The C++ and C standards are silent.
+//   POSIX standard is being followed (as a guideline).
+
+#include <locale>
+#include <limits>
+#include <cassert>
+
+typedef std::moneypunct<char> F;
+
+class Fnf
+    : public std::moneypunct<char, false>
+{
+public:
+    explicit Fnf(std::size_t refs = 0)
+        : std::moneypunct<char, false>(refs) {}
+};
+
+class Fnt
+    : public std::moneypunct<char, true>
+{
+public:
+    explicit Fnt(std::size_t refs = 0)
+        : std::moneypunct<char, true>(refs) {}
+};
+
+class Fwf
+    : public std::moneypunct<wchar_t, false>
+{
+public:
+    explicit Fwf(std::size_t refs = 0)
+        : std::moneypunct<wchar_t, false>(refs) {}
+};
+
+class Fwt
+    : public std::moneypunct<wchar_t, true>
+{
+public:
+    explicit Fwt(std::size_t refs = 0)
+        : std::moneypunct<wchar_t, true>(refs) {}
+};
+
+int main()
+{
+    {
+        Fnf f(1);
+        assert(f.positive_sign() == std::string());
+    }
+    {
+        Fnt f(1);
+        assert(f.positive_sign() == std::string());
+    }
+    {
+        Fwf f(1);
+        assert(f.positive_sign() == std::wstring());
+    }
+    {
+        Fwt f(1);
+        assert(f.positive_sign() == std::wstring());
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/thousands_sep.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/thousands_sep.pass.cpp
new file mode 100644
index 0000000..668273c
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/thousands_sep.pass.cpp
@@ -0,0 +1,75 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class moneypunct<charT, International>
+
+// charT thousands_sep() const;
+
+// The C++ and C standards are silent.
+//   POSIX standard is being followed (as a guideline).
+
+#include <locale>
+#include <limits>
+#include <cassert>
+
+typedef std::moneypunct<char> F;
+
+class Fnf
+    : public std::moneypunct<char, false>
+{
+public:
+    explicit Fnf(std::size_t refs = 0)
+        : std::moneypunct<char, false>(refs) {}
+};
+
+class Fnt
+    : public std::moneypunct<char, true>
+{
+public:
+    explicit Fnt(std::size_t refs = 0)
+        : std::moneypunct<char, true>(refs) {}
+};
+
+class Fwf
+    : public std::moneypunct<wchar_t, false>
+{
+public:
+    explicit Fwf(std::size_t refs = 0)
+        : std::moneypunct<wchar_t, false>(refs) {}
+};
+
+class Fwt
+    : public std::moneypunct<wchar_t, true>
+{
+public:
+    explicit Fwt(std::size_t refs = 0)
+        : std::moneypunct<wchar_t, true>(refs) {}
+};
+
+int main()
+{
+    {
+        Fnf f(1);
+        assert(f.thousands_sep() == std::numeric_limits<char>::max());
+    }
+    {
+        Fnt f(1);
+        assert(f.thousands_sep() == std::numeric_limits<char>::max());
+    }
+    {
+        Fwf f(1);
+        assert(f.thousands_sep() == std::numeric_limits<wchar_t>::max());
+    }
+    {
+        Fwt f(1);
+        assert(f.thousands_sep() == std::numeric_limits<wchar_t>::max());
+    }
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.virtuals/tested_elsewhere.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.virtuals/tested_elsewhere.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.virtuals/tested_elsewhere.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct/money_base.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct/money_base.pass.cpp
new file mode 100644
index 0000000..8a82dbb
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct/money_base.pass.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class money_base
+// {
+// public:
+//     enum part {none, space, symbol, sign, value};
+//     struct pattern {char field[4];};
+// };
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::money_base mb;
+    assert(mb.none == 0);
+    assert(mb.space == 1);
+    assert(mb.symbol == 2);
+    assert(mb.sign == 3);
+    assert(mb.value == 4);
+    assert(sizeof(std::money_base::pattern) == 4);
+    std::money_base::pattern p;
+    p.field[0] = std::money_base::none;
+}
diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp
new file mode 100644
index 0000000..95a7d4f
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class _CharT, bool _International = false>
+// class moneypunct
+//     : public locale::facet,
+//       public money_base
+// {
+// public:
+//     typedef _CharT                  char_type;
+//     typedef basic_string<char_type> string_type;
+
+#include <locale>
+#include <type_traits>
+
+int main()
+{
+    static_assert((std::is_base_of<std::locale::facet, std::moneypunct<char> >::value), "");
+    static_assert((std::is_base_of<std::locale::facet, std::moneypunct<wchar_t> >::value), "");
+    static_assert((std::is_base_of<std::money_base, std::moneypunct<char> >::value), "");
+    static_assert((std::is_base_of<std::money_base, std::moneypunct<wchar_t> >::value), "");
+    static_assert((std::is_same<std::moneypunct<char>::char_type, char>::value), "");
+    static_assert((std::is_same<std::moneypunct<wchar_t>::char_type, wchar_t>::value), "");
+    static_assert((std::is_same<std::moneypunct<char>::string_type, std::string>::value), "");
+    static_assert((std::is_same<std::moneypunct<wchar_t>::string_type, std::wstring>::value), "");
+}
diff --git a/test/localization/locale.categories/category.monetary/nothing_to_do.pass.cpp b/test/localization/locale.categories/category.monetary/nothing_to_do.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/category.monetary/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.nm.put/ctor.pass.cpp b/test/localization/locale.categories/category.numeric/locale.nm.put/ctor.pass.cpp
new file mode 100644
index 0000000..81889e4
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.nm.put/ctor.pass.cpp
@@ -0,0 +1,52 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_put<charT, OutputIterator>
+
+// explicit num_put(size_t refs = 0);
+
+#include <locale>
+#include <cassert>
+
+typedef std::num_put<char, char*> F;
+
+class my_facet
+    : public F
+{
+public:
+    static int count;
+
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {++count;}
+
+    ~my_facet() {--count;}
+};
+
+int my_facet::count = 0;
+
+int main()
+{
+    {
+        std::locale l(std::locale::classic(), new my_facet);
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f(1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/iterators.h b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/iterators.h
new file mode 100644
index 0000000..791e416
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/iterators.h
@@ -0,0 +1,33 @@
+#ifndef ITERATORS_H
+#define ITERATORS_H
+
+#include <iterator>
+
+template <class It>
+class output_iterator
+{
+    It it_;
+
+    template <class U> friend class output_iterator;
+public:
+    typedef          std::output_iterator_tag                  iterator_category;
+    typedef typename std::iterator_traits<It>::value_type      value_type;
+    typedef typename std::iterator_traits<It>::difference_type difference_type;
+    typedef It                                                 pointer;
+    typedef typename std::iterator_traits<It>::reference       reference;
+
+    It base() const {return it_;}
+
+    output_iterator() : it_() {}
+    explicit output_iterator(It it) : it_(it) {}
+    template <class U>
+        output_iterator(const output_iterator<U>& u) :it_(u.it_) {}
+
+    reference operator*() const {return *it_;}
+
+    output_iterator& operator++() {++it_; return *this;}
+    output_iterator operator++(int)
+        {output_iterator tmp(*this); ++(*this); return tmp;}
+};
+
+#endif
diff --git a/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_bool.pass.cpp b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_bool.pass.cpp
new file mode 100644
index 0000000..d9319ae
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_bool.pass.cpp
@@ -0,0 +1,100 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_put<charT, OutputIterator>
+
+// iter_type put(iter_type s, ios_base& iob, char_type fill, bool v) const;
+
+#include <locale>
+#include <ios>
+#include <cassert>
+#include <streambuf>
+#include "iterators.h"
+
+typedef std::num_put<char, output_iterator<char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+class my_numpunct
+    : public std::numpunct<char>
+{
+public:
+    my_numpunct() : std::numpunct<char>() {}
+
+protected:
+    virtual string_type do_truename() const {return "yes";}
+    virtual string_type do_falsename() const {return "no";}
+};
+
+int main()
+{
+    const my_facet f(1);
+    {
+        std::ios ios(0);
+        {
+            bool v = false;
+            char str[50];
+            output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+            std::string ex(str, iter.base());
+            assert(ex == "0");
+        }
+        {
+            bool v = true;
+            char str[50];
+            output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+            std::string ex(str, iter.base());
+            assert(ex == "1");
+        }
+    }
+    {
+        std::ios ios(0);
+        boolalpha(ios);
+        {
+            bool v = false;
+            char str[50];
+            output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+            std::string ex(str, iter.base());
+            assert(ex == "false");
+        }
+        {
+            bool v = true;
+            char str[50];
+            output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+            std::string ex(str, iter.base());
+            assert(ex == "true");
+        }
+    }
+    {
+        std::ios ios(0);
+        boolalpha(ios);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        {
+            bool v = false;
+            char str[50];
+            output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+            std::string ex(str, iter.base());
+            assert(ex == "no");
+        }
+        {
+            bool v = true;
+            char str[50];
+            output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+            std::string ex(str, iter.base());
+            assert(ex == "yes");
+        }
+    }
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_double.pass.cpp b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_double.pass.cpp
new file mode 100644
index 0000000..6ee7094
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_double.pass.cpp
@@ -0,0 +1,17887 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_put<charT, OutputIterator>
+
+// iter_type put(iter_type s, ios_base& iob, char_type fill, double v) const;
+
+#include <locale>
+#include <ios>
+#include <cassert>
+#include <streambuf>
+#include <cmath>
+#include "iterators.h"
+
+typedef std::num_put<char, output_iterator<char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+class my_numpunct
+    : public std::numpunct<char>
+{
+public:
+    my_numpunct() : std::numpunct<char>() {}
+
+protected:
+    virtual char_type do_decimal_point() const {return ';';}
+    virtual char_type do_thousands_sep() const {return '_';}
+    virtual std::string do_grouping() const {return std::string("\1\2\3");}
+};
+
+void test1()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        double v = +0.;
+        std::ios ios(0);
+        // %g
+        {
+            ios.precision(0);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(1);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(6);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(16);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(60);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+void test2()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        double v = 1234567890.125;
+        std::ios ios(0);
+        // %g
+        {
+            ios.precision(0);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.e+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;e+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.E+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;E+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(1);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.e+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;e+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.E+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;E+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(6);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.23457e+09**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;23457e+09**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.23457e+09**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;23457e+09**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.23457e+09*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************+1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*************1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;23457e+09*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************+1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*************1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.23457e+09*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************+1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*************1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;23457e+09*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************+1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*************1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.23457E+09**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;23457E+09**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.23457E+09**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;23457E+09**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.23457E+09*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************+1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*************1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;23457E+09*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************+1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*************1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.23457E+09*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************+1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*************1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;23457E+09*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************+1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*************1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(16);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125***********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000****");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125**********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********+1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000***");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125***********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000****");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125**********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********+1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000***");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(60);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125***********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125**********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********+1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125***********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125**********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********+1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+void test3()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        double v = +0.;
+        std::ios ios(0);
+        fixed(ios);
+        // %f
+        {
+            ios.precision(0);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(1);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************+0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************+0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************+0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************+0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************+0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************+0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************+0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************+0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(6);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************+0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************+0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************+0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************+0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************+0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************+0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************+0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************+0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(16);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(60);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+void test4()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        double v = 1234567890.125;
+        std::ios ios(0);
+        fixed(ios);
+        // %f
+        {
+            ios.precision(0);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890***************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***************1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***************1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0***********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;**********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************+1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**************1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0**********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********+1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************+1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*************1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********+1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*********1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890***************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***************1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***************1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0***********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;**********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************+1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**************1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0**********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********+1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************+1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*************1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********+1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*********1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(1);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.1*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;1*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.1*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;1*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.1************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************+1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;1********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.1************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************+1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;1********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.1*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;1*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.1*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;1*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.1************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************+1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;1********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.1************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************+1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;1********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(6);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000****");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000****");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000***");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000***");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000****");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000****");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000***");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000***");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(16);
+            {}
+            ios.precision(60);
+            {}
+        }
+    }
+}
+
+void test5()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        double v = -0.;
+        std::ios ios(0);
+        scientific(ios);
+        // %e
+        {
+            ios.precision(0);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0e+00*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************-0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******************0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0e+00*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************-0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******************0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.e+00******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0.e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0.e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;e+00******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0;e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0;e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0e+00*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************-0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******************0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0e+00*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************-0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******************0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.e+00******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0.e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0.e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;e+00******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0;e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0;e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0E+00*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************-0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******************0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0E+00*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************-0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******************0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.E+00******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0.E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0.E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;E+00******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0;E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0;E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0E+00*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************-0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******************0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0E+00*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************-0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******************0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.E+00******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0.E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0.E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;E+00******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0;E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0;E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(1);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0e+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0e+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0e+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0e+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0e+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0e+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0e+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0e+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0E+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0E+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0E+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0E+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0E+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0E+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0E+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0E+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(6);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000e+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000e+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000e+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000e+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000e+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000e+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000e+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000e+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000E+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000E+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000E+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000E+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000E+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000E+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000E+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000E+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(16);
+            {
+            }
+            ios.precision(60);
+            {
+            }
+        }
+    }
+}
+
+void test6()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        double v = 1234567890.125;
+        std::ios ios(0);
+        scientific(ios);
+        // %e
+        {
+            ios.precision(0);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.e+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;e+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.E+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;E+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(1);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.2e+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;2e+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.2e+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;2e+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.2e+09*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;2e+09*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.2e+09*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;2e+09*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.2E+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;2E+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.2E+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;2E+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.2E+09*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;2E+09*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.2E+09*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;2E+09*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(6);
+            {
+            }
+            ios.precision(16);
+            {
+            }
+            ios.precision(60);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+void test7()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        double v = -0.;
+        std::ios ios(0);
+        hexfloat(ios);
+        // %a
+        {
+            ios.precision(0);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(1);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(6);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(16);
+            {
+            }
+            ios.precision(60);
+            {
+            }
+        }
+    }
+}
+
+void test8()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        double v = 1234567890.125;
+        std::ios ios(0);
+        hexfloat(ios);
+        // %a
+        {
+            ios.precision(0);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1.26580b488p+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x********1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1;26580b488p+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x********1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1.26580b488p+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x********1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1;26580b488p+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x********1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1.26580b488p+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1;26580b488p+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1.26580b488p+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1;26580b488p+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1.26580B488P+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X********1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1;26580B488P+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X********1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1.26580B488P+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X********1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1;26580B488P+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X********1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1.26580B488P+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1;26580B488P+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1.26580B488P+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1;26580B488P+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(1);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1.26580b488p+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x********1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1;26580b488p+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x********1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1.26580b488p+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x********1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1;26580b488p+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x********1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1.26580b488p+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1;26580b488p+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1.26580b488p+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1;26580b488p+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1.26580B488P+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X********1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1;26580B488P+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X********1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1.26580B488P+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X********1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1;26580B488P+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X********1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1.26580B488P+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1;26580B488P+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1.26580B488P+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1;26580B488P+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(6);
+            {
+            }
+            ios.precision(16);
+            {
+            }
+            ios.precision(60);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1.26580b488p+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x********1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1;26580b488p+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x********1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1.26580b488p+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x********1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x1;26580b488p+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x********1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1.26580b488p+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1;26580b488p+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1.26580b488p+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0x1.26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x1;26580b488p+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0x1;26580b488p+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1.26580B488P+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X********1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1;26580B488P+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X********1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1.26580B488P+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X********1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X1;26580B488P+30********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X********1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1.26580B488P+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1;26580B488P+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1.26580B488P+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0X1.26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X1;26580B488P+30*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0X1;26580B488P+30");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+int main()
+{
+    test1();
+    test2();
+    test3();
+    test4();
+    test5();
+    test6();
+    test7();
+    test8();
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long.pass.cpp b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long.pass.cpp
new file mode 100644
index 0000000..a172c13
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long.pass.cpp
@@ -0,0 +1,371 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_put<charT, OutputIterator>
+
+// iter_type put(iter_type s, ios_base& iob, char_type fill, long v) const;
+
+#include <locale>
+#include <ios>
+#include <cassert>
+#include <streambuf>
+#include "iterators.h"
+
+typedef std::num_put<char, output_iterator<char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+class my_numpunct
+    : public std::numpunct<char>
+{
+public:
+    my_numpunct() : std::numpunct<char>() {}
+
+protected:
+    virtual char_type do_thousands_sep() const {return '_';}
+    virtual std::string do_grouping() const {return std::string("\1\2\3");}
+};
+
+int main()
+{
+    const my_facet f(1);
+    {
+        std::ios ios(0);
+        long v = 0;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0");
+    }
+    {
+        std::ios ios(0);
+        long v = 1;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1");
+    }
+    {
+        std::ios ios(0);
+        long v = -1;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1");
+    }
+    {
+        std::ios ios(0);
+        long v = -1000;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1000");
+    }
+    {
+        std::ios ios(0);
+        long v = 1000;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1000");
+    }
+    {
+        std::ios ios(0);
+        showpos(ios);
+        long v = 1000;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "+1000");
+    }
+    {
+        std::ios ios(0);
+        oct(ios);
+        long v = 1000;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1750");
+    }
+    {
+        std::ios ios(0);
+        oct(ios);
+        showbase(ios);
+        long v = 1000;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "01750");
+    }
+    {
+        std::ios ios(0);
+        hex(ios);
+        long v = 1000;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "3e8");
+    }
+    {
+        std::ios ios(0);
+        hex(ios);
+        showbase(ios);
+        long v = 1000;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0x3e8");
+    }
+    {
+        std::ios ios(0);
+        hex(ios);
+        showbase(ios);
+        uppercase(ios);
+        long v = 1000;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0X3E8");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        hex(ios);
+        showbase(ios);
+        uppercase(ios);
+        long v = 1000;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0X3E_8");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        hex(ios);
+        showbase(ios);
+        long v = 2147483647;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0x7f_fff_ff_f");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        oct(ios);
+        long v = 0123467;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "123_46_7");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        oct(ios);
+        showbase(ios);
+        long v = 0123467;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0_123_46_7");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        oct(ios);
+        showbase(ios);
+        right(ios);
+        ios.width(15);
+        long v = 0123467;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "*****0_123_46_7");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        oct(ios);
+        showbase(ios);
+        left(ios);
+        ios.width(15);
+        long v = 0123467;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0_123_46_7*****");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        oct(ios);
+        showbase(ios);
+        internal(ios);
+        ios.width(15);
+        long v = 0123467;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "*****0_123_46_7");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        hex(ios);
+        showbase(ios);
+        right(ios);
+        ios.width(15);
+        long v = 2147483647;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "**0x7f_fff_ff_f");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        hex(ios);
+        showbase(ios);
+        left(ios);
+        ios.width(15);
+        long v = 2147483647;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0x7f_fff_ff_f**");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        hex(ios);
+        showbase(ios);
+        internal(ios);
+        ios.width(15);
+        long v = 2147483647;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0x**7f_fff_ff_f");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        showpos(ios);
+        long v = 1000;
+        right(ios);
+        ios.width(10);
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "***+1_00_0");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        showpos(ios);
+        long v = 1000;
+        left(ios);
+        ios.width(10);
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "+1_00_0***");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        showpos(ios);
+        long v = 1000;
+        internal(ios);
+        ios.width(10);
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "+***1_00_0");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        long v = -1000;
+        right(ios);
+        showpos(ios);
+        ios.width(10);
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "***-1_00_0");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        long v = -1000;
+        left(ios);
+        ios.width(10);
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1_00_0***");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        long v = -1000;
+        internal(ios);
+        ios.width(10);
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-***1_00_0");
+        assert(ios.width() == 0);
+    }
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp
new file mode 100644
index 0000000..58f384e
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp
@@ -0,0 +1,26241 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_put<charT, OutputIterator>
+
+// iter_type put(iter_type s, ios_base& iob, char_type fill, long double v) const;
+
+#include <locale>
+#include <ios>
+#include <cassert>
+#include <streambuf>
+#include <cmath>
+#include "iterators.h"
+
+typedef std::num_put<char, output_iterator<char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+class my_numpunct
+    : public std::numpunct<char>
+{
+public:
+    my_numpunct() : std::numpunct<char>() {}
+
+protected:
+    virtual char_type do_decimal_point() const {return ';';}
+    virtual char_type do_thousands_sep() const {return '_';}
+    virtual std::string do_grouping() const {return std::string("\1\2\3");}
+};
+
+void test1()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        long double v = +0.;
+        std::ios ios(0);
+        // %g
+        {
+            ios.precision(0);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(1);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(6);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(16);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(60);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+void test2()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        long double v = -0.;
+        std::ios ios(0);
+        // %g
+        {
+            ios.precision(0);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(1);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(6);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0.00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0;00000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(16);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******-0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******-0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******-0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******-0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******-0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******-0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******-0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******0.000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******-0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******0;000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(60);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;00000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+void test3()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        long double v = 1234567890.125;
+        std::ios ios(0);
+        // %g
+        {
+            ios.precision(0);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.e+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;e+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.E+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;E+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(1);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.e+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;e+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.E+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;E+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(6);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.23457e+09**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;23457e+09**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.23457e+09**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;23457e+09**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.23457e+09*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************+1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*************1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;23457e+09*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************+1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*************1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.23457e+09*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************+1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*************1.23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;23457e+09*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************+1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*************1;23457e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.23457E+09**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;23457E+09**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.23457E+09**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;23457E+09**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.23457E+09*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************+1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*************1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;23457E+09*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************+1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*************1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.23457E+09*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************+1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*************1.23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;23457E+09*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************+1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*************1;23457E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(16);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125***********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000****");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125**********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********+1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000***");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125***********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000****");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125**********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********+1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000***");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(60);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125***********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125**********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********+1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125***********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125**********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********+1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********1234567890.125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******1_234_567_89_0;125");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;12500000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+void test4()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        long double v = -INFINITY;
+        std::ios ios(0);
+        // %g
+        {
+            ios.precision(0);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(1);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(6);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-inf*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-inf");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************inf");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-INF*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-INF");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************INF");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(16);
+            {}
+            ios.precision(60);
+            {}
+        }
+    }
+}
+
+void test5()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        long double v = std::nan("");
+        std::ios ios(0);
+        // %g
+        {
+            ios.precision(0);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "nan");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "nan**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************nan");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************nan");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "nan");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "nan**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************nan");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************nan");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "nan");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "nan**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************nan");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************nan");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "nan");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "nan**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************nan");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************nan");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "nan");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "nan**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************nan");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************nan");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "nan");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "nan**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************nan");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************nan");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "nan");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "nan**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************nan");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************nan");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "nan");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "nan**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************nan");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************nan");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "NAN");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "NAN**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************NAN");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************NAN");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "NAN");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "NAN**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************NAN");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************NAN");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "NAN");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "NAN**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************NAN");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************NAN");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "NAN");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "NAN**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************NAN");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************NAN");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "NAN");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "NAN**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************NAN");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************NAN");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "NAN");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "NAN**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************NAN");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************NAN");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "NAN");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "NAN**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************NAN");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************NAN");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "NAN");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "NAN**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************NAN");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************NAN");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(1);
+            {}
+            ios.precision(6);
+            {}
+            ios.precision(16);
+            {}
+            ios.precision(60);
+            {}
+        }
+    }
+}
+
+void test6()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        long double v = +0.;
+        std::ios ios(0);
+        fixed(ios);
+        // %f
+        {
+            ios.precision(0);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0************************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************+0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(1);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************+0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************+0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************+0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************+0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************+0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************+0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************+0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************+0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(6);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************+0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************+0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************+0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************+0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************+0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************+0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************+0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************+0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(16);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.0000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;0000000000000000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******+0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(60);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+void test7()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        long double v = -0.;
+        std::ios ios(0);
+        fixed(ios);
+        // %f
+        {
+            ios.precision(0);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0***********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********************-0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-***********************0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;**********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********************-0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-**********************0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(1);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-0.0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************0.0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0*********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********************-0;0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*********************0;0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(6);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************-0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************-0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************-0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************-0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************-0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************-0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************-0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************-0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************-0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************-0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************-0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************-0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************-0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************-0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************-0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-****************0.000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****************-0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-****************0;000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(16);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******-0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******-0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******-0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******-0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******-0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******-0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******-0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******-0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******-0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******-0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******-0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******-0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******-0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******-0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******-0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******0.0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0000000000000000******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******-0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******0;0000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(60);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000000000000000000000000000000000000000000000000000000000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+void test8()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        long double v = 1234567890.125;
+        std::ios ios(0);
+        fixed(ios);
+        // %f
+        {
+            ios.precision(0);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890***************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***************1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***************1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0***********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;**********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************+1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**************1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0**********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********+1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************+1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*************1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********+1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*********1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890***************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***************1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***************1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0***********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***********1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;**********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890**************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**************+1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**************1234567890");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0**********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "**********+1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+**********1_234_567_89_0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************+1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*************1234567890.");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********+1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*********1_234_567_89_0;");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(1);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.1*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;1*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.1*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;1*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.1************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************+1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;1********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.1************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************+1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;1********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.1*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;1*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.1*************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;1*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.1************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************+1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;1********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.1************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************+1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+************1234567890.1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;1********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********1_234_567_89_0;1");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(6);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000****");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000****");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000***");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000***");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000****");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1234567890.125000********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1_234_567_89_0;125000****");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "****1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000***");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1234567890.125000*******");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******+1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******1234567890.125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1_234_567_89_0;125000***");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "***+1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+***1_234_567_89_0;125000");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(16);
+            {}
+            ios.precision(60);
+            {}
+        }
+    }
+}
+
+void test9()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        long double v = -0.;
+        std::ios ios(0);
+        scientific(ios);
+        // %e
+        {
+            ios.precision(0);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0e+00*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************-0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******************0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0e+00*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************-0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******************0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.e+00******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0.e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0.e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;e+00******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0;e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0;e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0e+00*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************-0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******************0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0e+00*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************-0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******************0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.e+00******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0.e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0.e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;e+00******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0;e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0;e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0E+00*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************-0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******************0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0E+00*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************-0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******************0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.E+00******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0.E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0.E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;E+00******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0;E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0;E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0E+00*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************-0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******************0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0E+00*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************-0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*******************0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.E+00******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0.E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0.E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;E+00******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0;E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0;E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(1);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0e+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0e+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0e+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0e+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0e+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0e+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0e+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0.0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0e+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0;0e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0E+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0E+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0E+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0E+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0E+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0E+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.0E+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0.0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;0E+00*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0;0E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(6);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000e+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000e+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000e+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000e+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000e+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000e+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000e+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0.000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000e+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0;000000e+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000E+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000E+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000E+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000E+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000E+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000E+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0.000000E+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0.000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0;000000E+00************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "************-0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-************0;000000E+00");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(16);
+            {
+            }
+            ios.precision(60);
+            {
+            }
+        }
+    }
+}
+
+void test10()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        long double v = 1234567890.125;
+        std::ios ios(0);
+        scientific(ios);
+        // %e
+        {
+            ios.precision(0);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1e+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1e+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.e+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1.e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;e+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1;e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1E+09********************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1E+09*******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*******************+1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*******************1E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.E+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1.E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;E+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************+1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+******************1;E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(1);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.2e+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;2e+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.2e+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;2e+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.2e+09*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;2e+09*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.2e+09*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************1.2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;2e+09*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************1;2e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.2E+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;2E+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.2E+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;2E+09******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.2E+09*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;2E+09*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.2E+09*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************1.2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;2E+09*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************+1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+*****************1;2E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(6);
+            {
+            }
+            ios.precision(16);
+            {
+            }
+            ios.precision(60);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000e+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1.234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+1;234567890125000000000000000000000000000000000000000000000000E+09");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+void test11()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        long double v = -0.;
+        std::ios ios(0);
+        hexfloat(ios);
+        // %a
+        {
+            ios.precision(0);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(1);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(6);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0p+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0x0p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0.p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0.p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0x0;p+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0x0;p+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0P+0******************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "******************-0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-******************0X0P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0.P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0.P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-0X0;P+0*****************");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*****************-0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "-*****************0X0;P+0");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(16);
+            {
+            }
+            ios.precision(60);
+            {
+            }
+        }
+    }
+}
+
+void test12()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        long double v = 1234567890.125;
+        std::ios ios(0);
+        hexfloat(ios);
+        // %a
+        {
+            ios.precision(0);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9.32c05a44p+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x*********9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9;32c05a44p+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x*********9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9.32c05a44p+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x*********9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9;32c05a44p+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x*********9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9.32c05a44p+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9;32c05a44p+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9.32c05a44p+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9;32c05a44p+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9.32C05A44P+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X*********9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9;32C05A44P+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X*********9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9.32C05A44P+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X*********9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9;32C05A44P+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X*********9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9.32C05A44P+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9;32C05A44P+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9.32C05A44P+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9;32C05A44P+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(1);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9.32c05a44p+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x*********9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9;32c05a44p+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x*********9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9.32c05a44p+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x*********9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9;32c05a44p+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x*********9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9.32c05a44p+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9;32c05a44p+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9.32c05a44p+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9;32c05a44p+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9.32C05A44P+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X*********9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9;32C05A44P+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X*********9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9.32C05A44P+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X*********9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9;32C05A44P+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X*********9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9.32C05A44P+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9;32C05A44P+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9.32C05A44P+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9;32C05A44P+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            ios.precision(6);
+            {
+            }
+            ios.precision(16);
+            {
+            }
+            ios.precision(60);
+            {
+                nouppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9.32c05a44p+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x*********9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9;32c05a44p+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x*********9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9.32c05a44p+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x*********9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x9;32c05a44p+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0x*********9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9.32c05a44p+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9;32c05a44p+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9.32c05a44p+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0x9.32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0x9;32c05a44p+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0x9;32c05a44p+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+                uppercase(ios);
+                {
+                    noshowpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9.32C05A44P+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X*********9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9;32C05A44P+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X*********9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9.32C05A44P+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X*********9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X9;32C05A44P+27*********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "*********0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "0X*********9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                    showpos(ios);
+                    {
+                        noshowpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9.32C05A44P+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9;32C05A44P+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                        showpoint(ios);
+                        {
+                            ios.imbue(lc);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9.32C05A44P+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0X9.32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                            ios.imbue(lg);
+                            {
+                                ios.width(0);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                left(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+0X9;32C05A44P+27********");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                right(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "********+0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                                ios.width(25);
+                                internal(ios);
+                                {
+                                    iter = f.put(output_iterator<char*>(str), ios, '*', v);
+                                    std::string ex(str, iter.base());
+                                    assert(ex == "+********0X9;32C05A44P+27");
+                                    assert(ios.width() == 0);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+int main()
+{
+    test1();
+    test2();
+    test3();
+    test4();
+    test5();
+    test6();
+    test7();
+    test8();
+    test9();
+    test10();
+    test11();
+    test12();
+    char str[200];
+    output_iterator<char*> iter;
+    std::locale lc = std::locale::classic();
+    std::locale lg(lc, new my_numpunct);
+    const my_facet f(1);
+    {
+        long double v = -INFINITY;
+    }
+    {
+        long double v = std::nan("");
+    }
+
+    {
+        long double v = +0.;
+    }
+    {
+        long double v = -INFINITY;
+    }
+    {
+        long double v = std::nan("");
+    }
+    {
+        long double v = -INFINITY;
+    }
+    {
+        long double v = std::nan("");
+    }
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_long.pass.cpp b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_long.pass.cpp
new file mode 100644
index 0000000..f1886e5
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_long.pass.cpp
@@ -0,0 +1,344 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_put<charT, OutputIterator>
+
+// iter_type put(iter_type s, ios_base& iob, char_type fill, long long v) const;
+
+#include <locale>
+#include <ios>
+#include <cassert>
+#include <streambuf>
+#include "iterators.h"
+
+typedef std::num_put<char, output_iterator<char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+class my_numpunct
+    : public std::numpunct<char>
+{
+public:
+    my_numpunct() : std::numpunct<char>() {}
+
+protected:
+    virtual char_type do_thousands_sep() const {return '_';}
+    virtual std::string do_grouping() const {return std::string("\1\2\3");}
+};
+
+int main()
+{
+    const my_facet f(1);
+    {
+        std::ios ios(0);
+        long long v = 0;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0");
+    }
+    {
+        std::ios ios(0);
+        long long v = 1;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1");
+    }
+    {
+        std::ios ios(0);
+        long long v = -1;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1");
+    }
+    {
+        std::ios ios(0);
+        long long v = -1000;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1000");
+    }
+    {
+        std::ios ios(0);
+        long long v = 1000;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1000");
+    }
+    {
+        std::ios ios(0);
+        showpos(ios);
+        long long v = 1000;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "+1000");
+    }
+    {
+        std::ios ios(0);
+        oct(ios);
+        long long v = 1000;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1750");
+    }
+    {
+        std::ios ios(0);
+        oct(ios);
+        showbase(ios);
+        long long v = 1000;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "01750");
+    }
+    {
+        std::ios ios(0);
+        hex(ios);
+        long long v = 1000;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "3e8");
+    }
+    {
+        std::ios ios(0);
+        hex(ios);
+        showbase(ios);
+        long long v = 1000;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0x3e8");
+    }
+    {
+        std::ios ios(0);
+        hex(ios);
+        showbase(ios);
+        uppercase(ios);
+        long long v = 1000;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0X3E8");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        hex(ios);
+        showbase(ios);
+        uppercase(ios);
+        long long v = 1000;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0X3E_8");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        hex(ios);
+        showbase(ios);
+        long long v = 2147483647;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0x7f_fff_ff_f");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        oct(ios);
+        long long v = 0123467;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "123_46_7");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        oct(ios);
+        showbase(ios);
+        long long v = 0123467;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0_123_46_7");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        oct(ios);
+        showbase(ios);
+        right(ios);
+        ios.width(15);
+        long long v = 0123467;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "*****0_123_46_7");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        oct(ios);
+        showbase(ios);
+        left(ios);
+        ios.width(15);
+        long long v = 0123467;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0_123_46_7*****");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        oct(ios);
+        showbase(ios);
+        internal(ios);
+        ios.width(15);
+        long long v = 0123467;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "*****0_123_46_7");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        hex(ios);
+        showbase(ios);
+        right(ios);
+        ios.width(15);
+        long long v = 2147483647;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "**0x7f_fff_ff_f");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        hex(ios);
+        showbase(ios);
+        left(ios);
+        ios.width(15);
+        long long v = 2147483647;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0x7f_fff_ff_f**");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        hex(ios);
+        showbase(ios);
+        internal(ios);
+        ios.width(15);
+        long long v = 2147483647;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0x**7f_fff_ff_f");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        showpos(ios);
+        long long v = 1000;
+        right(ios);
+        ios.width(10);
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "***+1_00_0");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        showpos(ios);
+        long long v = 1000;
+        left(ios);
+        ios.width(10);
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "+1_00_0***");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        showpos(ios);
+        long long v = 1000;
+        internal(ios);
+        ios.width(10);
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "+***1_00_0");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        long long v = -1000;
+        right(ios);
+        showpos(ios);
+        ios.width(10);
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "***-1_00_0");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        long long v = -1000;
+        left(ios);
+        ios.width(10);
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-1_00_0***");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        long long v = -1000;
+        internal(ios);
+        ios.width(10);
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "-***1_00_0");
+        assert(ios.width() == 0);
+    }
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_pointer.pass.cpp b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_pointer.pass.cpp
new file mode 100644
index 0000000..03a3352
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_pointer.pass.cpp
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_put<charT, OutputIterator>
+
+// iter_type put(iter_type s, ios_base& iob, char_type fill, void* v) const;
+
+#include <locale>
+#include <ios>
+#include <cassert>
+#include <streambuf>
+#include "iterators.h"
+
+typedef std::num_put<char, output_iterator<char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+int main()
+{
+    const my_facet f(1);
+    {
+        std::ios ios(0);
+        void* v = 0;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0x0");
+    }
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long.pass.cpp b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long.pass.cpp
new file mode 100644
index 0000000..79288df
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long.pass.cpp
@@ -0,0 +1,374 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_put<charT, OutputIterator>
+
+// iter_type put(iter_type s, ios_base& iob, char_type fill, unsigned long v) const;
+
+#include <locale>
+#include <ios>
+#include <cassert>
+#include <streambuf>
+#include "iterators.h"
+
+typedef std::num_put<char, output_iterator<char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+class my_numpunct
+    : public std::numpunct<char>
+{
+public:
+    my_numpunct() : std::numpunct<char>() {}
+
+protected:
+    virtual char_type do_thousands_sep() const {return '_';}
+    virtual std::string do_grouping() const {return std::string("\1\2\3");}
+};
+
+int main()
+{
+    const my_facet f(1);
+    {
+        std::ios ios(0);
+        unsigned long v = 0;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0");
+    }
+    {
+        std::ios ios(0);
+        unsigned long v = 1;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1");
+    }
+    {
+        std::ios ios(0);
+        unsigned long v = -1;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == (sizeof(unsigned long) == 4 ? "4294967295" : "18446744073709551615"));
+    }
+    {
+        std::ios ios(0);
+        unsigned long v = -1000;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == (sizeof(unsigned long) == 4 ? "4294966296" : "18446744073709550616"));
+    }
+    {
+        std::ios ios(0);
+        unsigned long v = 1000;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1000");
+    }
+    {
+        std::ios ios(0);
+        showpos(ios);
+        unsigned long v = 1000;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1000");
+    }
+    {
+        std::ios ios(0);
+        oct(ios);
+        unsigned long v = 1000;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1750");
+    }
+    {
+        std::ios ios(0);
+        oct(ios);
+        showbase(ios);
+        unsigned long v = 1000;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "01750");
+    }
+    {
+        std::ios ios(0);
+        hex(ios);
+        unsigned long v = 1000;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "3e8");
+    }
+    {
+        std::ios ios(0);
+        hex(ios);
+        showbase(ios);
+        unsigned long v = 1000;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0x3e8");
+    }
+    {
+        std::ios ios(0);
+        hex(ios);
+        showbase(ios);
+        uppercase(ios);
+        unsigned long v = 1000;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0X3E8");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        hex(ios);
+        showbase(ios);
+        uppercase(ios);
+        unsigned long v = 1000;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0X3E_8");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        hex(ios);
+        showbase(ios);
+        unsigned long v = 2147483647;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0x7f_fff_ff_f");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        oct(ios);
+        unsigned long v = 0123467;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "123_46_7");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        oct(ios);
+        showbase(ios);
+        unsigned long v = 0123467;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0_123_46_7");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        oct(ios);
+        showbase(ios);
+        right(ios);
+        ios.width(15);
+        unsigned long v = 0123467;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "*****0_123_46_7");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        oct(ios);
+        showbase(ios);
+        left(ios);
+        ios.width(15);
+        unsigned long v = 0123467;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0_123_46_7*****");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        oct(ios);
+        showbase(ios);
+        internal(ios);
+        ios.width(15);
+        unsigned long v = 0123467;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "*****0_123_46_7");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        hex(ios);
+        showbase(ios);
+        right(ios);
+        ios.width(15);
+        unsigned long v = 2147483647;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "**0x7f_fff_ff_f");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        hex(ios);
+        showbase(ios);
+        left(ios);
+        ios.width(15);
+        unsigned long v = 2147483647;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0x7f_fff_ff_f**");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        hex(ios);
+        showbase(ios);
+        internal(ios);
+        ios.width(15);
+        unsigned long v = 2147483647;
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0x**7f_fff_ff_f");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        showpos(ios);
+        unsigned long v = 1000;
+        right(ios);
+        ios.width(10);
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "****1_00_0");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        showpos(ios);
+        unsigned long v = 1000;
+        left(ios);
+        ios.width(10);
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1_00_0****");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        showpos(ios);
+        unsigned long v = 1000;
+        internal(ios);
+        ios.width(10);
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "****1_00_0");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        unsigned long v = -1000;
+        right(ios);
+        showpos(ios);
+        ios.width(10);
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == (sizeof(unsigned long) == 4 ? "4_294_966_29_6"
+                                                 : "18_446_744_073_709_550_61_6"));
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        unsigned long v = -1000;
+        left(ios);
+        ios.width(10);
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == (sizeof(unsigned long) == 4 ? "4_294_966_29_6"
+                                                 : "18_446_744_073_709_550_61_6"));
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        unsigned long v = -1000;
+        internal(ios);
+        ios.width(10);
+        char str[50];
+        std::ios_base::iostate err = ios.goodbit;
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == (sizeof(unsigned long) == 4 ? "4_294_966_29_6"
+                                                 : "18_446_744_073_709_550_61_6"));
+        assert(ios.width() == 0);
+    }
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long_long.pass.cpp b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long_long.pass.cpp
new file mode 100644
index 0000000..908aacf
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long_long.pass.cpp
@@ -0,0 +1,344 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_put<charT, OutputIterator>
+
+// iter_type put(iter_type s, ios_base& iob, char_type fill, unsigned long long v) const;
+
+#include <locale>
+#include <ios>
+#include <cassert>
+#include <streambuf>
+#include "iterators.h"
+
+typedef std::num_put<char, output_iterator<char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+class my_numpunct
+    : public std::numpunct<char>
+{
+public:
+    my_numpunct() : std::numpunct<char>() {}
+
+protected:
+    virtual char_type do_thousands_sep() const {return '_';}
+    virtual std::string do_grouping() const {return std::string("\1\2\3");}
+};
+
+int main()
+{
+    const my_facet f(1);
+    {
+        std::ios ios(0);
+        unsigned long long v = 0;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0");
+    }
+    {
+        std::ios ios(0);
+        unsigned long long v = 1;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1");
+    }
+    {
+        std::ios ios(0);
+        unsigned long long v = -1;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == (sizeof(unsigned long long) == 4 ? "4294967295" : "18446744073709551615"));
+    }
+    {
+        std::ios ios(0);
+        unsigned long long v = -1000;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "18446744073709550616");
+    }
+    {
+        std::ios ios(0);
+        unsigned long long v = 1000;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1000");
+    }
+    {
+        std::ios ios(0);
+        showpos(ios);
+        unsigned long long v = 1000;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1000");
+    }
+    {
+        std::ios ios(0);
+        oct(ios);
+        unsigned long long v = 1000;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1750");
+    }
+    {
+        std::ios ios(0);
+        oct(ios);
+        showbase(ios);
+        unsigned long long v = 1000;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "01750");
+    }
+    {
+        std::ios ios(0);
+        hex(ios);
+        unsigned long long v = 1000;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "3e8");
+    }
+    {
+        std::ios ios(0);
+        hex(ios);
+        showbase(ios);
+        unsigned long long v = 1000;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0x3e8");
+    }
+    {
+        std::ios ios(0);
+        hex(ios);
+        showbase(ios);
+        uppercase(ios);
+        unsigned long long v = 1000;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0X3E8");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        hex(ios);
+        showbase(ios);
+        uppercase(ios);
+        unsigned long long v = 1000;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0X3E_8");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        hex(ios);
+        showbase(ios);
+        unsigned long long v = 2147483647;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0x7f_fff_ff_f");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        oct(ios);
+        unsigned long long v = 0123467;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "123_46_7");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        oct(ios);
+        showbase(ios);
+        unsigned long long v = 0123467;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0_123_46_7");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        oct(ios);
+        showbase(ios);
+        right(ios);
+        ios.width(15);
+        unsigned long long v = 0123467;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "*****0_123_46_7");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        oct(ios);
+        showbase(ios);
+        left(ios);
+        ios.width(15);
+        unsigned long long v = 0123467;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0_123_46_7*****");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        oct(ios);
+        showbase(ios);
+        internal(ios);
+        ios.width(15);
+        unsigned long long v = 0123467;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "*****0_123_46_7");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        hex(ios);
+        showbase(ios);
+        right(ios);
+        ios.width(15);
+        unsigned long long v = 2147483647;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "**0x7f_fff_ff_f");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        hex(ios);
+        showbase(ios);
+        left(ios);
+        ios.width(15);
+        unsigned long long v = 2147483647;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0x7f_fff_ff_f**");
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        hex(ios);
+        showbase(ios);
+        internal(ios);
+        ios.width(15);
+        unsigned long long v = 2147483647;
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "0x**7f_fff_ff_f");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        showpos(ios);
+        unsigned long long v = 1000;
+        right(ios);
+        ios.width(10);
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "****1_00_0");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        showpos(ios);
+        unsigned long long v = 1000;
+        left(ios);
+        ios.width(10);
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "1_00_0****");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        showpos(ios);
+        unsigned long long v = 1000;
+        internal(ios);
+        ios.width(10);
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "****1_00_0");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        unsigned long long v = -1000;
+        right(ios);
+        showpos(ios);
+        ios.width(10);
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "18_446_744_073_709_550_61_6");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        unsigned long long v = -1000;
+        left(ios);
+        ios.width(10);
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "18_446_744_073_709_550_61_6");
+        assert(ios.width() == 0);
+    }
+    {
+        std::ios ios(0);
+        ios.imbue(std::locale(std::locale::classic(), new my_numpunct));
+        unsigned long long v = -1000;
+        internal(ios);
+        ios.width(10);
+        char str[50];
+        output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v);
+        std::string ex(str, iter.base());
+        assert(ex == "18_446_744_073_709_550_61_6");
+        assert(ios.width() == 0);
+    }
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.virtuals/tested_elsewhere.pass.cpp b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.virtuals/tested_elsewhere.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.virtuals/tested_elsewhere.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.nm.put/types.pass.cpp b/test/localization/locale.categories/category.numeric/locale.nm.put/types.pass.cpp
new file mode 100644
index 0000000..373df8d
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.nm.put/types.pass.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT, class OutputIterator = ostreambuf_iterator<charT> > 
+// class num_put
+//     : public locale::facet
+// {
+// public: 
+//     typedef charT          char_type; 
+//     typedef OutputIterator iter_type;
+
+#include <locale>
+#include <iterator>
+#include <type_traits>
+
+int main()
+{
+    static_assert((std::is_base_of<std::locale::facet, std::num_put<char> >::value), "");
+    static_assert((std::is_base_of<std::locale::facet, std::num_put<wchar_t> >::value), "");
+    static_assert((std::is_same<std::num_put<char>::char_type, char>::value), "");
+    static_assert((std::is_same<std::num_put<wchar_t>::char_type, wchar_t>::value), "");
+    static_assert((std::is_same<std::num_put<char>::iter_type, std::ostreambuf_iterator<char> >::value), "");
+    static_assert((std::is_same<std::num_put<wchar_t>::iter_type, std::ostreambuf_iterator<wchar_t> >::value), "");
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.num.get/ctor.pass.cpp b/test/localization/locale.categories/category.numeric/locale.num.get/ctor.pass.cpp
new file mode 100644
index 0000000..b1b3553
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.num.get/ctor.pass.cpp
@@ -0,0 +1,52 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_get<charT, InputIterator>
+
+// explicit num_get(size_t refs = 0);
+
+#include <locale>
+#include <cassert>
+
+typedef std::num_get<char, char*> F;
+
+class my_facet
+    : public F
+{
+public:
+    static int count;
+
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {++count;}
+
+    ~my_facet() {--count;}
+};
+
+int my_facet::count = 0;
+
+int main()
+{
+    {
+        std::locale l(std::locale::classic(), new my_facet);
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f(1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_bool.pass.cpp b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_bool.pass.cpp
new file mode 100644
index 0000000..158078a
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_bool.pass.cpp
@@ -0,0 +1,230 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_get<charT, InputIterator>
+
+// iter_type get(iter_type in, iter_type end, ios_base&,
+//               ios_base::iostate& err, bool& v) const;
+
+#include <locale>
+#include <ios>
+#include <cassert>
+#include <streambuf>
+#include "iterators.h"
+
+typedef std::num_get<char, input_iterator<const char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+class p1
+    : public std::numpunct<char>
+{
+public:
+    p1() : std::numpunct<char>() {}
+
+protected:
+    virtual string_type do_truename() const {return "a";}
+    virtual string_type do_falsename() const {return "abb";}
+};
+
+class p2
+    : public std::numpunct<char>
+{
+public:
+    p2() : std::numpunct<char>() {}
+
+protected:
+    virtual string_type do_truename() const {return "a";}
+    virtual string_type do_falsename() const {return "ab";}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    {
+        const char str[] = "1";
+        std::ios_base::iostate err = ios.goodbit;
+        bool b;
+        input_iterator<const char*> iter = 
+            f.get(input_iterator<const char*>(str),
+                  input_iterator<const char*>(str+sizeof(str)),
+                  ios, err, b);
+        assert(iter.base() == str+sizeof(str)-1);
+        assert(err == ios.goodbit);
+        assert(b == true);
+    }
+    {
+        const char str[] = "0";
+        std::ios_base::iostate err = ios.goodbit;
+        bool b;
+        input_iterator<const char*> iter = 
+            f.get(input_iterator<const char*>(str),
+                  input_iterator<const char*>(str+sizeof(str)),
+                  ios, err, b);
+        assert(iter.base() == str+sizeof(str)-1);
+        assert(err == ios.goodbit);
+        assert(b == false);
+    }
+    {
+        const char str[] = "12";
+        std::ios_base::iostate err = ios.goodbit;
+        bool b;
+        input_iterator<const char*> iter = 
+            f.get(input_iterator<const char*>(str),
+                  input_iterator<const char*>(str+sizeof(str)),
+                  ios, err, b);
+        assert(iter.base() == str+sizeof(str)-1);
+        assert(err == ios.failbit);
+        assert(b == true);
+    }
+    {
+        const char str[] = "*12";
+        std::ios_base::iostate err = ios.goodbit;
+        bool b;
+        input_iterator<const char*> iter = 
+            f.get(input_iterator<const char*>(str),
+                  input_iterator<const char*>(str+sizeof(str)),
+                  ios, err, b);
+        assert(iter.base() == str+0);
+        assert(err == ios.failbit);
+        assert(b == false);
+    }
+    boolalpha(ios);
+    {
+        const char str[] = "1";
+        std::ios_base::iostate err = ios.goodbit;
+        bool b;
+        input_iterator<const char*> iter = 
+            f.get(input_iterator<const char*>(str),
+                  input_iterator<const char*>(str+sizeof(str)),
+                  ios, err, b);
+        assert(iter.base() == str+0);
+        assert(err == ios.failbit);
+        assert(b == false);
+    }
+    {
+        const char str[] = "true";
+        std::ios_base::iostate err = ios.goodbit;
+        bool b;
+        input_iterator<const char*> iter = 
+            f.get(input_iterator<const char*>(str),
+                  input_iterator<const char*>(str+sizeof(str)),
+                  ios, err, b);
+        assert(iter.base() == str+sizeof(str)-1);
+        assert(err == ios.goodbit);
+        assert(b == true);
+    }
+    {
+        const char str[] = "false";
+        std::ios_base::iostate err = ios.goodbit;
+        bool b;
+        input_iterator<const char*> iter = 
+            f.get(input_iterator<const char*>(str),
+                  input_iterator<const char*>(str+sizeof(str)),
+                  ios, err, b);
+        assert(iter.base() == str+sizeof(str)-1);
+        assert(err == ios.goodbit);
+        assert(b == false);
+    }
+    ios.imbue(std::locale(ios.getloc(), new p1));
+    {
+        const char str[] = "a";
+        std::ios_base::iostate err = ios.goodbit;
+        bool b;
+        input_iterator<const char*> iter = 
+            f.get(input_iterator<const char*>(str),
+                  input_iterator<const char*>(str+1),
+                  ios, err, b);
+        assert(iter.base() == str+1);
+        assert(err == ios.eofbit);
+        assert(b == true);
+    }
+    {
+        const char str[] = "abc";
+        std::ios_base::iostate err = ios.goodbit;
+        bool b;
+        input_iterator<const char*> iter = 
+            f.get(input_iterator<const char*>(str),
+                  input_iterator<const char*>(str+3),
+                  ios, err, b);
+        assert(iter.base() == str+2);
+        assert(err == ios.failbit);
+        assert(b == false);
+    }
+    {
+        const char str[] = "acc";
+        std::ios_base::iostate err = ios.goodbit;
+        bool b;
+        input_iterator<const char*> iter = 
+            f.get(input_iterator<const char*>(str),
+                  input_iterator<const char*>(str+3),
+                  ios, err, b);
+        assert(iter.base() == str+1);
+        assert(err == ios.goodbit);
+        assert(b == true);
+    }
+    ios.imbue(std::locale(ios.getloc(), new p2));
+    {
+        const char str[] = "a";
+        std::ios_base::iostate err = ios.goodbit;
+        bool b;
+        input_iterator<const char*> iter = 
+            f.get(input_iterator<const char*>(str),
+                  input_iterator<const char*>(str+1),
+                  ios, err, b);
+        assert(iter.base() == str+1);
+        assert(err == ios.eofbit);
+        assert(b == true);
+    }
+    {
+        const char str[] = "ab";
+        std::ios_base::iostate err = ios.goodbit;
+        bool b;
+        input_iterator<const char*> iter = 
+            f.get(input_iterator<const char*>(str),
+                  input_iterator<const char*>(str+2),
+                  ios, err, b);
+        assert(iter.base() == str+2);
+        assert(err == ios.eofbit);
+        assert(b == false);
+    }
+    {
+        const char str[] = "abc";
+        std::ios_base::iostate err = ios.goodbit;
+        bool b;
+        input_iterator<const char*> iter = 
+            f.get(input_iterator<const char*>(str),
+                  input_iterator<const char*>(str+3),
+                  ios, err, b);
+        assert(iter.base() == str+2);
+        assert(err == ios.goodbit);
+        assert(b == false);
+    }
+    {
+        const char str[] = "ac";
+        std::ios_base::iostate err = ios.goodbit;
+        bool b;
+        input_iterator<const char*> iter = 
+            f.get(input_iterator<const char*>(str),
+                  input_iterator<const char*>(str+2),
+                  ios, err, b);
+        assert(iter.base() == str+1);
+        assert(err == ios.goodbit);
+        assert(b == true);
+    }
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp
new file mode 100644
index 0000000..569cf7a
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp
@@ -0,0 +1,228 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_get<charT, InputIterator>
+
+// iter_type get(iter_type in, iter_type end, ios_base&,
+//               ios_base::iostate& err, double& v) const;
+
+#include <locale>
+#include <ios>
+#include <cassert>
+#include <streambuf>
+#include <cmath>
+#include "iterators.h"
+
+typedef std::num_get<char, input_iterator<const char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+class my_numpunct
+    : public std::numpunct<char>
+{
+public:
+    my_numpunct() : std::numpunct<char>() {}
+
+protected:
+    virtual char_type do_decimal_point() const {return ';';}
+    virtual char_type do_thousands_sep() const {return '_';}
+    virtual std::string do_grouping() const {return std::string("\1\2\3");}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    double v = -1;
+    {
+        const char str[] = "123";
+        assert((ios.flags() & ios.basefield) == ios.dec);
+        assert(ios.getloc().name() == "C");
+        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(v == 123);
+    }
+    {
+        const char str[] = "-123";
+        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(v == -123);
+    }
+    {
+        const char str[] = "123.5";
+        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(v == 123.5);
+    }
+    {
+        const char str[] = "125e-1";
+        hex(ios);
+        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(v == 125e-1);
+    }
+    {
+        const char str[] = "0x125p-1";
+        hex(ios);
+        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(v == 0x125p-1);
+    }
+    {
+        const char str[] = "inf";
+        hex(ios);
+        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(v == INFINITY);
+    }
+    {
+        const char str[] = "INF";
+        hex(ios);
+        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(v == INFINITY);
+    }
+    {
+        const char str[] = "-inf";
+        hex(ios);
+        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(v == -INFINITY);
+    }
+    {
+        const char str[] = "-INF";
+        hex(ios);
+        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(v == -INFINITY);
+    }
+    {
+        const char str[] = "nan";
+        hex(ios);
+        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::isnan(v));
+    }
+    {
+        const char str[] = "NAN";
+        hex(ios);
+        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::isnan(v));
+    }
+    {
+        v = -1;
+        const char str[] = "123_456_78_9;125";
+        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+3);
+        assert(err == ios.goodbit);
+        assert(v == 123);
+    }
+    ios.imbue(std::locale(std::locale(), new my_numpunct));
+    {
+        v = -1;
+        const char str[] = "123_456_78_9;125";
+        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(v == 123456789.125);
+    }
+    {
+        v = -1;
+        const char str[] = "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_"
+                           "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_"
+                           "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_"
+                           "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_"
+                           "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_"
+                           "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_"
+                           "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_"
+                           "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_"
+                           "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_"
+                           "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_"
+                           "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_";
+        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.failbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp
new file mode 100644
index 0000000..ca0382d
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp
@@ -0,0 +1,170 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_get<charT, InputIterator>
+
+// iter_type get(iter_type in, iter_type end, ios_base&,
+//               ios_base::iostate& err, float& v) const;
+
+#include <locale>
+#include <ios>
+#include <cassert>
+#include <streambuf>
+#include <cmath>
+#include "iterators.h"
+
+typedef std::num_get<char, input_iterator<const char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    float v = -1;
+    {
+        const char str[] = "123";
+        assert((ios.flags() & ios.basefield) == ios.dec);
+        assert(ios.getloc().name() == "C");
+        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(v == 123);
+    }
+    {
+        const char str[] = "-123";
+        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(v == -123);
+    }
+    {
+        const char str[] = "123.5";
+        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(v == 123.5);
+    }
+    {
+        const char str[] = "125e-1";
+        hex(ios);
+        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(v == 125e-1);
+    }
+    {
+        const char str[] = "0x125p-1";
+        hex(ios);
+        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(v == 0x125p-1);
+    }
+    {
+        const char str[] = "inf";
+        hex(ios);
+        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(v == INFINITY);
+    }
+    {
+        const char str[] = "INF";
+        hex(ios);
+        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(v == INFINITY);
+    }
+    {
+        const char str[] = "-inf";
+        hex(ios);
+        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(v == -INFINITY);
+    }
+    {
+        const char str[] = "-INF";
+        hex(ios);
+        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(v == -INFINITY);
+    }
+    {
+        const char str[] = "nan";
+        hex(ios);
+        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::isnan(v));
+    }
+    {
+        const char str[] = "NAN";
+        hex(ios);
+        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::isnan(v));
+    }
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long.pass.cpp b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long.pass.cpp
new file mode 100644
index 0000000..971f9e7
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long.pass.cpp
@@ -0,0 +1,507 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_get<charT, InputIterator>
+
+// iter_type get(iter_type in, iter_type end, ios_base&,
+//               ios_base::iostate& err, long& v) const;
+
+#include <locale>
+#include <ios>
+#include <cassert>
+#include <streambuf>
+#include "iterators.h"
+
+typedef std::num_get<char, input_iterator<const char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+class my_numpunct
+    : public std::numpunct<char>
+{
+public:
+    my_numpunct() : std::numpunct<char>() {}
+
+protected:
+    virtual char_type do_thousands_sep() const {return '_';}
+    virtual std::string do_grouping() const {return std::string("\1\2\3");}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    long v = -1;
+    {
+        const char str[] = "123";
+        assert((ios.flags() & ios.basefield) == ios.dec);
+        assert(ios.getloc().name() == "C");
+        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+3);
+        assert(err == ios.goodbit);
+        assert(v == 123);
+    }
+    {
+        const char str[] = "-123";
+        assert((ios.flags() & ios.basefield) == ios.dec);
+        assert(ios.getloc().name() == "C");
+        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+4);
+        assert(err == ios.goodbit);
+        assert(v == -123);
+    }
+    {
+        const char str[] = "123";
+        oct(ios);
+        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+3);
+        assert(err == ios.goodbit);
+        assert(v == 83);
+    }
+    {
+        const char str[] = "123";
+        hex(ios);
+        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+3);
+        assert(err == ios.goodbit);
+        assert(v == 291);
+    }
+    {
+        const char str[] = "0x123";
+        hex(ios);
+        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(v == 291);
+    }
+    {
+        const char str[] = "123";
+        ios.setf(0, ios.basefield);
+        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(v == 123);
+    }
+    {
+        const char str[] = "0x123";
+        ios.setf(0, ios.basefield);
+        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(v == 291);
+    }
+    {
+        const char str[] = "0123";
+        ios.setf(0, ios.basefield);
+        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(v == 83);
+    }
+    dec(ios);
+    ios.imbue(std::locale(std::locale(), new my_numpunct));
+    {
+        v = -1;
+        const char str[] = "123";
+        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.failbit);
+        assert(v == 123);
+    }
+    {
+        v = -1;
+        const char str[] = "+1";
+        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(v == 1);
+    }
+    {
+        v = -1;
+        const char str[] = "+1_";
+        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.failbit);
+        assert(v == 1);
+    }
+    {
+        v = -1;
+        const char str[] = "+_1";
+        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.failbit);
+        assert(v == 1);
+    }
+    {
+        v = -1;
+        const char str[] = "_+1";
+        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.failbit);
+        assert(v == 1);
+    }
+    {
+        v = -1;
+        const char str[] = "+1__";
+        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.failbit);
+        assert(v == 1);
+    }
+    {
+        v = -1;
+        const char str[] = "+_1_";
+        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.failbit);
+        assert(v == 1);
+    }
+    {
+        v = -1;
+        const char str[] = "_+1_";
+        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.failbit);
+        assert(v == 1);
+    }
+    {
+        v = -1;
+        const char str[] = "+__1";
+        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.failbit);
+        assert(v == 1);
+    }
+    {
+        v = -1;
+        const char str[] = "_+_1";
+        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.failbit);
+        assert(v == 1);
+    }
+    {
+        v = -1;
+        const char str[] = "__+1";
+        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.failbit);
+        assert(v == 1);
+    }
+    {
+        v = -1;
+        const char str[] = "+1_2";
+        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(v == 12);
+    }
+    {
+        v = -1;
+        const char str[] = "+12_";
+        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.failbit);
+        assert(v == 12);
+    }
+    {
+        v = -1;
+        const char str[] = "+_12";
+        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.failbit);
+        assert(v == 12);
+    }
+    {
+        v = -1;
+        const char str[] = "+1__2";
+        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.failbit);
+        assert(v == 12);
+    }
+    {
+        v = -1;
+        const char str[] = "+12_3";
+        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(v == 123);
+    }
+    {
+        v = -1;
+        const char str[] = "+1_23";
+        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.failbit);
+        assert(v == 123);
+    }
+    {
+        v = -1;
+        const char str[] = "+1_23_4";
+        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(v == 1234);
+    }
+    {
+        v = -1;
+        const char str[] = "+123_4";
+        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.failbit);
+        assert(v == 1234);
+    }
+    {
+        v = -1;
+        const char str[] = "+12_34";
+        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.failbit);
+        assert(v == 1234);
+    }
+    {
+        v = -1;
+        const char str[] = "+12_34_5";
+        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(v == 12345);
+    }
+    {
+        v = -1;
+        const char str[] = "+123_45_6";
+        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(v == 123456);
+    }
+    {
+        v = -1;
+        const char str[] = "+1_23_45_6";
+        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.failbit);
+        assert(v == 123456);
+    }
+    {
+        v = -1;
+        const char str[] = "+1_234_56_7";
+        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(v == 1234567);
+    }
+    {
+        v = -1;
+        const char str[] = "+1_234_567_89_0";
+        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(v == 1234567890);
+    }
+    {
+        v = -1;
+        const char str[] = "-1_234_567_89_0";
+        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(v == -1234567890);
+    }
+    {
+        v = -1;
+        const char str[] = "1_234_567_89_0";
+        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(v == 1234567890);
+    }
+    {
+        v = -1;
+        const char str[] = "1234_567_89_0";
+        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.failbit);
+        assert(v == 1234567890);
+    }
+    {
+        v = -1;
+        const char str[] = "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_"
+                           "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_"
+                           "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_"
+                           "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_"
+                           "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_"
+                           "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_"
+                           "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_"
+                           "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_"
+                           "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_"
+                           "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_"
+                           "1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_1_2_3_4_5_6_7_8_9_0_";
+        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.failbit);
+        assert(v == std::numeric_limits<long>::max());
+    }
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_double.pass.cpp b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_double.pass.cpp
new file mode 100644
index 0000000..d8b6fb5
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_double.pass.cpp
@@ -0,0 +1,170 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_get<charT, InputIterator>
+
+// iter_type get(iter_type in, iter_type end, ios_base&,
+//               ios_base::iostate& err, long double& v) const;
+
+#include <locale>
+#include <ios>
+#include <cassert>
+#include <streambuf>
+#include <cmath>
+#include "iterators.h"
+
+typedef std::num_get<char, input_iterator<const char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    long double v = -1;
+    {
+        const char str[] = "123";
+        assert((ios.flags() & ios.basefield) == ios.dec);
+        assert(ios.getloc().name() == "C");
+        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(v == 123);
+    }
+    {
+        const char str[] = "-123";
+        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(v == -123);
+    }
+    {
+        const char str[] = "123.5";
+        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(v == 123.5);
+    }
+    {
+        const char str[] = "125e-1";
+        hex(ios);
+        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(v == 125e-1);
+    }
+    {
+        const char str[] = "0x125p-1";
+        hex(ios);
+        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(v == 0x125p-1);
+    }
+    {
+        const char str[] = "inf";
+        hex(ios);
+        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(v == INFINITY);
+    }
+    {
+        const char str[] = "INF";
+        hex(ios);
+        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(v == INFINITY);
+    }
+    {
+        const char str[] = "-inf";
+        hex(ios);
+        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(v == -INFINITY);
+    }
+    {
+        const char str[] = "-INF";
+        hex(ios);
+        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(v == -INFINITY);
+    }
+    {
+        const char str[] = "nan";
+        hex(ios);
+        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::isnan(v));
+    }
+    {
+        const char str[] = "NAN";
+        hex(ios);
+        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::isnan(v));
+    }
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_long.pass.cpp b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_long.pass.cpp
new file mode 100644
index 0000000..f2d2cf0
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_long.pass.cpp
@@ -0,0 +1,105 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_get<charT, InputIterator>
+
+// iter_type get(iter_type in, iter_type end, ios_base&,
+//               ios_base::iostate& err, long long& v) const;
+
+#include <locale>
+#include <ios>
+#include <cassert>
+#include <streambuf>
+#include "iterators.h"
+
+typedef std::num_get<char, input_iterator<const char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+class my_numpunct
+    : public std::numpunct<char>
+{
+public:
+    my_numpunct() : std::numpunct<char>() {}
+
+protected:
+    virtual char_type do_thousands_sep() const {return '_';}
+    virtual std::string do_grouping() const {return std::string("\1\2\3");}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    long long v = -1;
+    {
+        const char str[] = "0";
+        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(v == 0);
+    }
+    {
+        const char str[] = "1";
+        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(v == 1);
+    }
+    {
+        const char str[] = "-1";
+        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(v == -1);
+    }
+    hex(ios);
+    {
+        const char str[] = "0x7FFFFFFFFFFFFFFF";
+        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(v == 0x7FFFFFFFFFFFFFFFLL);
+    }
+    {
+        const char str[] = "-0x8000000000000000";
+        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(v == 0x8000000000000000LL);
+    }
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_pointer.pass.cpp b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_pointer.pass.cpp
new file mode 100644
index 0000000..c57a967
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_pointer.pass.cpp
@@ -0,0 +1,61 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_get<charT, InputIterator>
+
+// iter_type get(iter_type in, iter_type end, ios_base&,
+//               ios_base::iostate& err, void*& v) const;
+
+#include <locale>
+#include <ios>
+#include <cassert>
+#include <streambuf>
+#include "iterators.h"
+
+typedef std::num_get<char, input_iterator<const char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    {
+        const char str[] = "0x0";
+        std::ios_base::iostate err = ios.goodbit;
+        void* p;
+        input_iterator<const char*> iter = 
+            f.get(input_iterator<const char*>(str),
+                  input_iterator<const char*>(str+sizeof(str)),
+                  ios, err, p);
+        assert(iter.base() == str+sizeof(str)-1);
+        assert(err == ios.goodbit);
+        assert(p == 0);
+    }
+    {
+        const char str[] = "0x73";
+        std::ios_base::iostate err = ios.goodbit;
+        void* p;
+        input_iterator<const char*> iter = 
+            f.get(input_iterator<const char*>(str),
+                  input_iterator<const char*>(str+sizeof(str)),
+                  ios, err, p);
+        assert(iter.base() == str+sizeof(str)-1);
+        assert(err == ios.goodbit);
+        assert(p == (void*)0x73);
+    }
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_int.pass.cpp b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_int.pass.cpp
new file mode 100644
index 0000000..02e4a41
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_int.pass.cpp
@@ -0,0 +1,83 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_get<charT, InputIterator>
+
+// iter_type get(iter_type in, iter_type end, ios_base&,
+//               ios_base::iostate& err, unsigned int& v) const;
+
+#include <locale>
+#include <ios>
+#include <cassert>
+#include <streambuf>
+#include "iterators.h"
+
+typedef std::num_get<char, input_iterator<const char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+class my_numpunct
+    : public std::numpunct<char>
+{
+public:
+    my_numpunct() : std::numpunct<char>() {}
+
+protected:
+    virtual char_type do_thousands_sep() const {return '_';}
+    virtual std::string do_grouping() const {return std::string("\1\2\3");}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    unsigned int v = -1;
+    {
+        const char str[] = "0";
+        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(v == 0);
+    }
+    {
+        const char str[] = "1";
+        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(v == 1);
+    }
+    hex(ios);
+    {
+        const char str[] = "0xFFFFFFFF";
+        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(v == 0xFFFFFFFF);
+    }
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long.pass.cpp b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long.pass.cpp
new file mode 100644
index 0000000..9a623d6
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long.pass.cpp
@@ -0,0 +1,83 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_get<charT, InputIterator>
+
+// iter_type get(iter_type in, iter_type end, ios_base&,
+//               ios_base::iostate& err, unsigned long& v) const;
+
+#include <locale>
+#include <ios>
+#include <cassert>
+#include <streambuf>
+#include "iterators.h"
+
+typedef std::num_get<char, input_iterator<const char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+class my_numpunct
+    : public std::numpunct<char>
+{
+public:
+    my_numpunct() : std::numpunct<char>() {}
+
+protected:
+    virtual char_type do_thousands_sep() const {return '_';}
+    virtual std::string do_grouping() const {return std::string("\1\2\3");}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    unsigned long v = -1;
+    {
+        const char str[] = "0";
+        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(v == 0);
+    }
+    {
+        const char str[] = "1";
+        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(v == 1);
+    }
+    hex(ios);
+    {
+        const char str[] = "0xFFFFFFFF";
+        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(v == 0xFFFFFFFF);
+    }
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long_long.pass.cpp b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long_long.pass.cpp
new file mode 100644
index 0000000..e2347a6
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long_long.pass.cpp
@@ -0,0 +1,83 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_get<charT, InputIterator>
+
+// iter_type get(iter_type in, iter_type end, ios_base&,
+//               ios_base::iostate& err, unsigned long long& v) const;
+
+#include <locale>
+#include <ios>
+#include <cassert>
+#include <streambuf>
+#include "iterators.h"
+
+typedef std::num_get<char, input_iterator<const char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+class my_numpunct
+    : public std::numpunct<char>
+{
+public:
+    my_numpunct() : std::numpunct<char>() {}
+
+protected:
+    virtual char_type do_thousands_sep() const {return '_';}
+    virtual std::string do_grouping() const {return std::string("\1\2\3");}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    unsigned long long v = -1;
+    {
+        const char str[] = "0";
+        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(v == 0);
+    }
+    {
+        const char str[] = "1";
+        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(v == 1);
+    }
+    hex(ios);
+    {
+        const char str[] = "0xFFFFFFFFFFFFFFFF";
+        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(v == 0xFFFFFFFFFFFFFFFFULL);
+    }
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_short.pass.cpp b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_short.pass.cpp
new file mode 100644
index 0000000..8249d1a
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_short.pass.cpp
@@ -0,0 +1,83 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_get<charT, InputIterator>
+
+// iter_type get(iter_type in, iter_type end, ios_base&,
+//               ios_base::iostate& err, unsigned short& v) const;
+
+#include <locale>
+#include <ios>
+#include <cassert>
+#include <streambuf>
+#include "iterators.h"
+
+typedef std::num_get<char, input_iterator<const char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+class my_numpunct
+    : public std::numpunct<char>
+{
+public:
+    my_numpunct() : std::numpunct<char>() {}
+
+protected:
+    virtual char_type do_thousands_sep() const {return '_';}
+    virtual std::string do_grouping() const {return std::string("\1\2\3");}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    unsigned short v = -1;
+    {
+        const char str[] = "0";
+        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(v == 0);
+    }
+    {
+        const char str[] = "1";
+        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(v == 1);
+    }
+    hex(ios);
+    {
+        const char str[] = "0xFFFF";
+        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(v == 0xFFFF);
+    }
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/iterators.h b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/iterators.h
new file mode 100644
index 0000000..85332ac
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/iterators.h
@@ -0,0 +1,251 @@
+#ifndef ITERATORS_H
+#define ITERATORS_H
+
+#include <iterator>
+
+template <class It>
+class input_iterator
+{
+    It it_;
+
+    template <class U> friend class input_iterator;
+public:
+    typedef          std::input_iterator_tag                   iterator_category;
+    typedef typename std::iterator_traits<It>::value_type      value_type;
+    typedef typename std::iterator_traits<It>::difference_type difference_type;
+    typedef It                                                 pointer;
+    typedef typename std::iterator_traits<It>::reference       reference;
+
+    It base() const {return it_;}
+
+    input_iterator() : it_() {}
+    explicit input_iterator(It it) : it_(it) {}
+    template <class U>
+        input_iterator(const input_iterator<U>& u) :it_(u.it_) {}
+
+    reference operator*() const {return *it_;}
+    pointer operator->() const {return it_;}
+
+    input_iterator& operator++() {++it_; return *this;}
+    input_iterator operator++(int)
+        {input_iterator tmp(*this); ++(*this); return tmp;}
+
+    friend bool operator==(const input_iterator& x, const input_iterator& y)
+        {return x.it_ == y.it_;}
+    friend bool operator!=(const input_iterator& x, const input_iterator& y)
+        {return !(x == y);}
+};
+
+template <class T, class U>
+inline
+bool
+operator==(const input_iterator<T>& x, const input_iterator<U>& y)
+{
+    return x.base() == y.base();
+}
+
+template <class T, class U>
+inline
+bool
+operator!=(const input_iterator<T>& x, const input_iterator<U>& y)
+{
+    return !(x == y);
+}
+
+template <class It>
+class forward_iterator
+{
+    It it_;
+
+    template <class U> friend class forward_iterator;
+public:
+    typedef          std::forward_iterator_tag                 iterator_category;
+    typedef typename std::iterator_traits<It>::value_type      value_type;
+    typedef typename std::iterator_traits<It>::difference_type difference_type;
+    typedef It                                                 pointer;
+    typedef typename std::iterator_traits<It>::reference       reference;
+
+    It base() const {return it_;}
+
+    forward_iterator() : it_() {}
+    explicit forward_iterator(It it) : it_(it) {}
+    template <class U>
+        forward_iterator(const forward_iterator<U>& u) :it_(u.it_) {}
+
+    reference operator*() const {return *it_;}
+    pointer operator->() const {return it_;}
+
+    forward_iterator& operator++() {++it_; return *this;}
+    forward_iterator operator++(int)
+        {forward_iterator tmp(*this); ++(*this); return tmp;}
+
+    friend bool operator==(const forward_iterator& x, const forward_iterator& y)
+        {return x.it_ == y.it_;}
+    friend bool operator!=(const forward_iterator& x, const forward_iterator& y)
+        {return !(x == y);}
+};
+
+template <class T, class U>
+inline
+bool
+operator==(const forward_iterator<T>& x, const forward_iterator<U>& y)
+{
+    return x.base() == y.base();
+}
+
+template <class T, class U>
+inline
+bool
+operator!=(const forward_iterator<T>& x, const forward_iterator<U>& y)
+{
+    return !(x == y);
+}
+
+template <class It>
+class bidirectional_iterator
+{
+    It it_;
+
+    template <class U> friend class bidirectional_iterator;
+public:
+    typedef          std::bidirectional_iterator_tag           iterator_category;
+    typedef typename std::iterator_traits<It>::value_type      value_type;
+    typedef typename std::iterator_traits<It>::difference_type difference_type;
+    typedef It                                                 pointer;
+    typedef typename std::iterator_traits<It>::reference       reference;
+
+    It base() const {return it_;}
+
+    bidirectional_iterator() : it_() {}
+    explicit bidirectional_iterator(It it) : it_(it) {}
+    template <class U>
+        bidirectional_iterator(const bidirectional_iterator<U>& u) :it_(u.it_) {}
+
+    reference operator*() const {return *it_;}
+    pointer operator->() const {return it_;}
+
+    bidirectional_iterator& operator++() {++it_; return *this;}
+    bidirectional_iterator operator++(int)
+        {bidirectional_iterator tmp(*this); ++(*this); return tmp;}
+
+    bidirectional_iterator& operator--() {--it_; return *this;}
+    bidirectional_iterator operator--(int)
+        {bidirectional_iterator tmp(*this); --(*this); return tmp;}
+};
+
+template <class T, class U>
+inline
+bool
+operator==(const bidirectional_iterator<T>& x, const bidirectional_iterator<U>& y)
+{
+    return x.base() == y.base();
+}
+
+template <class T, class U>
+inline
+bool
+operator!=(const bidirectional_iterator<T>& x, const bidirectional_iterator<U>& y)
+{
+    return !(x == y);
+}
+
+template <class It>
+class random_access_iterator
+{
+    It it_;
+
+    template <class U> friend class random_access_iterator;
+public:
+    typedef          std::random_access_iterator_tag           iterator_category;
+    typedef typename std::iterator_traits<It>::value_type      value_type;
+    typedef typename std::iterator_traits<It>::difference_type difference_type;
+    typedef It                                                 pointer;
+    typedef typename std::iterator_traits<It>::reference       reference;
+
+    It base() const {return it_;}
+
+    random_access_iterator() : it_() {}
+    explicit random_access_iterator(It it) : it_(it) {}
+   template <class U>
+        random_access_iterator(const random_access_iterator<U>& u) :it_(u.it_) {}
+
+    reference operator*() const {return *it_;}
+    pointer operator->() const {return it_;}
+
+    random_access_iterator& operator++() {++it_; return *this;}
+    random_access_iterator operator++(int)
+        {random_access_iterator tmp(*this); ++(*this); return tmp;}
+
+    random_access_iterator& operator--() {--it_; return *this;}
+    random_access_iterator operator--(int)
+        {random_access_iterator tmp(*this); --(*this); return tmp;}
+
+    random_access_iterator& operator+=(difference_type n) {it_ += n; return *this;}
+    random_access_iterator operator+(difference_type n) const
+        {random_access_iterator tmp(*this); tmp += n; return tmp;}
+    friend random_access_iterator operator+(difference_type n, random_access_iterator x)
+        {x += n; return x;}
+    random_access_iterator& operator-=(difference_type n) {return *this += -n;}
+    random_access_iterator operator-(difference_type n) const
+        {random_access_iterator tmp(*this); tmp -= n; return tmp;}
+
+    reference operator[](difference_type n) const {return it_[n];}
+};
+
+template <class T, class U>
+inline
+bool
+operator==(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
+{
+    return x.base() == y.base();
+}
+
+template <class T, class U>
+inline
+bool
+operator!=(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
+{
+    return !(x == y);
+}
+
+template <class T, class U>
+inline
+bool
+operator<(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
+{
+    return x.base() < y.base();
+}
+
+template <class T, class U>
+inline
+bool
+operator<=(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
+{
+    return !(y < x);
+}
+
+template <class T, class U>
+inline
+bool
+operator>(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
+{
+    return y < x;
+}
+
+template <class T, class U>
+inline
+bool
+operator>=(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
+{
+    return !(x < y);
+}
+
+template <class T, class U>
+inline
+typename std::iterator_traits<T>::difference_type
+operator-(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
+{
+    return x.base() - y.base();
+}
+
+#endif
diff --git a/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.virtuals/tested_elsewhere.pass.cpp b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.virtuals/tested_elsewhere.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.virtuals/tested_elsewhere.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/category.numeric/locale.num.get/types.pass.cpp b/test/localization/locale.categories/category.numeric/locale.num.get/types.pass.cpp
new file mode 100644
index 0000000..0b8c40d
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/locale.num.get/types.pass.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT, class InputIterator = istreambuf_iterator<charT> > 
+// class num_get
+//     : public locale::facet
+// {
+// public: 
+//     typedef charT char_type; 
+//     typedef InputIterator iter_type;
+
+#include <locale>
+#include <iterator>
+#include <type_traits>
+
+int main()
+{
+    static_assert((std::is_base_of<std::locale::facet, std::num_get<char> >::value), "");
+    static_assert((std::is_base_of<std::locale::facet, std::num_get<wchar_t> >::value), "");
+    static_assert((std::is_same<std::num_get<char>::char_type, char>::value), "");
+    static_assert((std::is_same<std::num_get<wchar_t>::char_type, wchar_t>::value), "");
+    static_assert((std::is_same<std::num_get<char>::iter_type, std::istreambuf_iterator<char> >::value), "");
+    static_assert((std::is_same<std::num_get<wchar_t>::iter_type, std::istreambuf_iterator<wchar_t> >::value), "");
+}
diff --git a/test/localization/locale.categories/category.numeric/nothing_to_do.pass.cpp b/test/localization/locale.categories/category.numeric/nothing_to_do.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/category.numeric/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get.byname/date_order.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/date_order.pass.cpp
new file mode 100644
index 0000000..8b69ecf
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get.byname/date_order.pass.cpp
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get_byname<charT, InputIterator>
+
+// dateorder date_order() const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef std::time_get_byname<char, input_iterator<const char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(const std::string& nm, std::size_t refs = 0)
+        : F(nm, refs) {}
+};
+
+int main()
+{
+    {
+        const my_facet f("en_US", 1);
+        assert(f.date_order() == std::time_base::mdy);
+    }
+    {
+        const my_facet f("fr_FR", 1);
+        assert(f.date_order() == std::time_base::dmy);
+    }
+    {
+        const my_facet f("ru_RU", 1);
+        assert(f.date_order() == std::time_base::dmy);
+    }
+    {
+        const my_facet f("zh_CN", 1);
+        assert(f.date_order() == std::time_base::ymd);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get.byname/date_order_wide.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/date_order_wide.pass.cpp
new file mode 100644
index 0000000..1b35be9
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get.byname/date_order_wide.pass.cpp
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get_byname<charT, InputIterator>
+
+// dateorder date_order() const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef std::time_get_byname<wchar_t, input_iterator<const wchar_t*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(const std::string& nm, std::size_t refs = 0)
+        : F(nm, refs) {}
+};
+
+int main()
+{
+    {
+        const my_facet f("en_US", 1);
+        assert(f.date_order() == std::time_base::mdy);
+    }
+    {
+        const my_facet f("fr_FR", 1);
+        assert(f.date_order() == std::time_base::dmy);
+    }
+    {
+        const my_facet f("ru_RU", 1);
+        assert(f.date_order() == std::time_base::dmy);
+    }
+    {
+        const my_facet f("zh_CN", 1);
+        assert(f.date_order() == std::time_base::ymd);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp
new file mode 100644
index 0000000..03a41d0
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp
@@ -0,0 +1,87 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get_byname<charT, InputIterator>
+
+// iter_type
+// get_date(iter_type s, iter_type end, ios_base& str,
+//          ios_base::iostate& err, tm* t) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const char*> I;
+
+typedef std::time_get_byname<char, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(const std::string& nm, std::size_t refs = 0)
+        : F(nm, refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const my_facet f("en_US", 1);
+        const char in[] = "06/10/2009";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_date(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_mon == 5);
+        assert(t.tm_mday == 10);
+        assert(t.tm_year == 109);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("fr_FR", 1);
+        const char in[] = "10.06.2009";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_date(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_mon == 5);
+        assert(t.tm_mday == 10);
+        assert(t.tm_year == 109);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("ru_RU", 1);
+        const char in[] = "10.06.2009";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_date(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_mon == 5);
+        assert(t.tm_mday == 10);
+        assert(t.tm_year == 109);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("zh_CN", 1);
+        const char in[] = "2009/06/10";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_date(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_mon == 5);
+        assert(t.tm_mday == 10);
+        assert(t.tm_year == 109);
+        assert(err == std::ios_base::eofbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp
new file mode 100644
index 0000000..b1750cb
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp
@@ -0,0 +1,87 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get_byname<charT, InputIterator>
+
+// iter_type
+// get_date(iter_type s, iter_type end, ios_base& str,
+//          ios_base::iostate& err, tm* t) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const wchar_t*> I;
+
+typedef std::time_get_byname<wchar_t, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(const std::string& nm, std::size_t refs = 0)
+        : F(nm, refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const my_facet f("en_US", 1);
+        const wchar_t in[] = L"06/10/2009";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_date(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_mon == 5);
+        assert(t.tm_mday == 10);
+        assert(t.tm_year == 109);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("fr_FR", 1);
+        const wchar_t in[] = L"10.06.2009";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_date(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_mon == 5);
+        assert(t.tm_mday == 10);
+        assert(t.tm_year == 109);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("ru_RU", 1);
+        const wchar_t in[] = L"10.06.2009";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_date(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_mon == 5);
+        assert(t.tm_mday == 10);
+        assert(t.tm_year == 109);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("zh_CN", 1);
+        const wchar_t in[] = L"2009/06/10";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_date(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_mon == 5);
+        assert(t.tm_mday == 10);
+        assert(t.tm_year == 109);
+        assert(err == std::ios_base::eofbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp
new file mode 100644
index 0000000..e5c0182
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname.pass.cpp
@@ -0,0 +1,79 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get_byname<charT, InputIterator>
+
+// iter_type
+// get_monthname(iter_type s, iter_type end, ios_base& str,
+//               ios_base::iostate& err, tm* t) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const char*> I;
+
+typedef std::time_get_byname<char, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(const std::string& nm, std::size_t refs = 0)
+        : F(nm, refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const my_facet f("en_US", 1);
+        const char in[] = "June";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_mon == 5);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("fr_FR", 1);
+        const char in[] = "juin";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_mon == 5);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("ru_RU", 1);
+        const char in[] = "\xD0\xB8\xD1\x8E\xD0\xBD\xD1\x8F";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_mon == 5);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("zh_CN", 1);
+        const char in[] = "\xE5\x85\xAD\xE6\x9C\x88";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_mon == 5);
+        assert(err == std::ios_base::eofbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp
new file mode 100644
index 0000000..5b2c829
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp
@@ -0,0 +1,88 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get_byname<charT, InputIterator>
+
+// iter_type
+// get_monthname(iter_type s, iter_type end, ios_base& str,
+//               ios_base::iostate& err, tm* t) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const wchar_t*> I;
+
+typedef std::time_get_byname<wchar_t, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(const std::string& nm, std::size_t refs = 0)
+        : F(nm, refs) {}
+};
+
+typedef std::time_put_byname<wchar_t, wchar_t*> F2;
+class my_facet2
+    : public F2
+{
+public:
+    explicit my_facet2(const std::string& nm, std::size_t refs = 0)
+        : F2(nm, refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const my_facet f("en_US", 1);
+        const wchar_t in[] = L"June";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_mon == 5);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("fr_FR", 1);
+        const wchar_t in[] = L"juin";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_mon == 5);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("ru_RU", 1);
+        const wchar_t in[] = L"\x438\x44E\x43D\x44F";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_mon == 5);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("zh_CN", 1);
+        const wchar_t in[] = L"\x516D\x6708";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_mon == 5);
+        assert(err == std::ios_base::eofbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp
new file mode 100644
index 0000000..6035c7a
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp
@@ -0,0 +1,158 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get_byname<charT, InputIterator>
+
+// iter_type get(iter_type s, iter_type end, ios_base& f, 
+//               ios_base::iostate& err, tm *t, char format, char modifier = 0) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const char*> I;
+
+typedef std::time_get_byname<char, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(const std::string& nm, std::size_t refs = 0)
+        : F(nm, refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const my_facet f("en_US", 1);
+        const char in[] = "Sat Dec 31 23:55:59 2061";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'c');
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_sec == 59);
+        assert(t.tm_min == 55);
+        assert(t.tm_hour == 23);
+        assert(t.tm_mday == 31);
+        assert(t.tm_mon == 11);
+        assert(t.tm_year == 161);
+        assert(t.tm_wday == 6);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("en_US", 1);
+        const char in[] = "23:55:59";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'X');
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_sec == 59);
+        assert(t.tm_min == 55);
+        assert(t.tm_hour == 23);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("fr_FR", 1);
+        const char in[] = "Sam 31 d""\xC3\xA9""c 23:55:59 2061";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'c');
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_sec == 59);
+        assert(t.tm_min == 55);
+        assert(t.tm_hour == 23);
+        assert(t.tm_mday == 31);
+        assert(t.tm_mon == 11);
+        assert(t.tm_year == 161);
+        assert(t.tm_wday == 6);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("fr_FR", 1);
+        const char in[] = "23:55:59";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'X');
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_sec == 59);
+        assert(t.tm_min == 55);
+        assert(t.tm_hour == 23);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("ru_RU", 1);
+        const char in[] = "\xD1\x81\xD1\x83\xD0\xB1\xD0\xB1"
+                          "\xD0\xBE\xD1\x82\xD0\xB0"
+                          ", 31 "
+                          "\xD0\xB4\xD0\xB5\xD0\xBA\xD0\xB0"
+                          "\xD0\xB1\xD1\x80\xD1\x8F"
+                          " 2061 "
+                          "\xD0\xB3"
+                          ". 23:55:59";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'c');
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_sec == 59);
+        assert(t.tm_min == 55);
+        assert(t.tm_hour == 23);
+        assert(t.tm_mday == 31);
+        assert(t.tm_mon == 11);
+        assert(t.tm_year == 161);
+        assert(t.tm_wday == 6);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("ru_RU", 1);
+        const char in[] = "23:55:59";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'X');
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_sec == 59);
+        assert(t.tm_min == 55);
+        assert(t.tm_hour == 23);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("zh_CN", 1);
+        const char in[] = "\xE5\x85\xAD"
+                          " 12/31 23:55:59 2061";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'c');
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_sec == 59);
+        assert(t.tm_min == 55);
+        assert(t.tm_hour == 23);
+        assert(t.tm_mday == 31);
+        assert(t.tm_mon == 11);
+        assert(t.tm_year == 161);
+        assert(t.tm_wday == 6);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("zh_CN", 1);
+        const char in[] = "23""\xE6\x97\xB6""55""\xE5\x88\x86""59""\xE7\xA7\x92";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'X');
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_sec == 59);
+        assert(t.tm_min == 55);
+        assert(t.tm_hour == 23);
+        assert(err == std::ios_base::eofbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
new file mode 100644
index 0000000..6a1fd67
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
@@ -0,0 +1,156 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get_byname<charT, InputIterator>
+
+// iter_type get(iter_type s, iter_type end, ios_base& f, 
+//               ios_base::iostate& err, tm *t, char format, char modifier = 0) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const wchar_t*> I;
+
+typedef std::time_get_byname<wchar_t, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(const std::string& nm, std::size_t refs = 0)
+        : F(nm, refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const my_facet f("en_US", 1);
+        const wchar_t in[] = L"Sat Dec 31 23:55:59 2061";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'c');
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_sec == 59);
+        assert(t.tm_min == 55);
+        assert(t.tm_hour == 23);
+        assert(t.tm_mday == 31);
+        assert(t.tm_mon == 11);
+        assert(t.tm_year == 161);
+        assert(t.tm_wday == 6);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("en_US", 1);
+        const wchar_t in[] = L"23:55:59";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'X');
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_sec == 59);
+        assert(t.tm_min == 55);
+        assert(t.tm_hour == 23);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("fr_FR", 1);
+        const wchar_t in[] = L"Sam 31 d""\xE9""c 23:55:59 2061";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'c');
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_sec == 59);
+        assert(t.tm_min == 55);
+        assert(t.tm_hour == 23);
+        assert(t.tm_mday == 31);
+        assert(t.tm_mon == 11);
+        assert(t.tm_year == 161);
+        assert(t.tm_wday == 6);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("fr_FR", 1);
+        const wchar_t in[] = L"23:55:59";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'X');
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_sec == 59);
+        assert(t.tm_min == 55);
+        assert(t.tm_hour == 23);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("ru_RU", 1);
+        const wchar_t in[] = L"\x441\x443\x431\x431\x43E\x442\x430"
+                          ", 31 "
+                          "\x434\x435\x43A\x430\x431\x440\x44F"
+                          " 2061 "
+                          "\x433"
+                          ". 23:55:59";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'c');
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_sec == 59);
+        assert(t.tm_min == 55);
+        assert(t.tm_hour == 23);
+        assert(t.tm_mday == 31);
+        assert(t.tm_mon == 11);
+        assert(t.tm_year == 161);
+        assert(t.tm_wday == 6);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("ru_RU", 1);
+        const wchar_t in[] = L"23:55:59";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'X');
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_sec == 59);
+        assert(t.tm_min == 55);
+        assert(t.tm_hour == 23);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("zh_CN", 1);
+        const wchar_t in[] = L"\x516D"
+                          " 12/31 23:55:59 2061";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'c');
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_sec == 59);
+        assert(t.tm_min == 55);
+        assert(t.tm_hour == 23);
+        assert(t.tm_mday == 31);
+        assert(t.tm_mon == 11);
+        assert(t.tm_year == 161);
+        assert(t.tm_wday == 6);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("zh_CN", 1);
+        const wchar_t in[] = L"23""\x65F6""55""\x5206""59""\x79D2";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'X');
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_sec == 59);
+        assert(t.tm_min == 55);
+        assert(t.tm_hour == 23);
+        assert(err == std::ios_base::eofbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get.byname/get_time.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_time.pass.cpp
new file mode 100644
index 0000000..b109a25
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_time.pass.cpp
@@ -0,0 +1,87 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get_byname<charT, InputIterator>
+
+// iter_type
+// get_time(iter_type s, iter_type end, ios_base& str,
+//          ios_base::iostate& err, tm* t) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const char*> I;
+
+typedef std::time_get_byname<char, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(const std::string& nm, std::size_t refs = 0)
+        : F(nm, refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const my_facet f("en_US", 1);
+        const char in[] = "13:14:15";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_hour == 13);
+        assert(t.tm_min == 14);
+        assert(t.tm_sec == 15);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("fr_FR", 1);
+        const char in[] = "13:14:15";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_hour == 13);
+        assert(t.tm_min == 14);
+        assert(t.tm_sec == 15);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("ru_RU", 1);
+        const char in[] = "13:14:15";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_hour == 13);
+        assert(t.tm_min == 14);
+        assert(t.tm_sec == 15);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("zh_CN", 1);
+        const char in[] = "13:14:15";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_hour == 13);
+        assert(t.tm_min == 14);
+        assert(t.tm_sec == 15);
+        assert(err == std::ios_base::eofbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get.byname/get_time_wide.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_time_wide.pass.cpp
new file mode 100644
index 0000000..6ccd733
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_time_wide.pass.cpp
@@ -0,0 +1,87 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get_byname<charT, InputIterator>
+
+// iter_type
+// get_time(iter_type s, iter_type end, ios_base& str,
+//          ios_base::iostate& err, tm* t) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const wchar_t*> I;
+
+typedef std::time_get_byname<wchar_t, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(const std::string& nm, std::size_t refs = 0)
+        : F(nm, refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const my_facet f("en_US", 1);
+        const wchar_t in[] = L"13:14:15";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_hour == 13);
+        assert(t.tm_min == 14);
+        assert(t.tm_sec == 15);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("fr_FR", 1);
+        const wchar_t in[] = L"13:14:15";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_hour == 13);
+        assert(t.tm_min == 14);
+        assert(t.tm_sec == 15);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("ru_RU", 1);
+        const wchar_t in[] = L"13:14:15";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_hour == 13);
+        assert(t.tm_min == 14);
+        assert(t.tm_sec == 15);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("zh_CN", 1);
+        const wchar_t in[] = L"13:14:15";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_hour == 13);
+        assert(t.tm_min == 14);
+        assert(t.tm_sec == 15);
+        assert(err == std::ios_base::eofbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp
new file mode 100644
index 0000000..0124b89
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp
@@ -0,0 +1,81 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get_byname<charT, InputIterator>
+
+// iter_type
+// get_weekday(iter_type s, iter_type end, ios_base& str,
+//             ios_base::iostate& err, tm* t) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const char*> I;
+
+typedef std::time_get_byname<char, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(const std::string& nm, std::size_t refs = 0)
+        : F(nm, refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const my_facet f("en_US", 1);
+        const char in[] = "Monday";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_wday == 1);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("fr_FR", 1);
+        const char in[] = "Lundi";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_wday == 1);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("ru_RU", 1);
+        const char in[] = "\xD0\xBF\xD0\xBE\xD0\xBD\xD0\xB5"
+                          "\xD0\xB4\xD0\xB5\xD0\xBB\xD1\x8C"
+                          "\xD0\xBD\xD0\xB8\xD0\xBA";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_wday == 1);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("zh_CN", 1);
+        const char in[] = "\xE6\x98\x9F\xE6\x9C\x9F\xE4\xB8\x80";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_wday == 1);
+        assert(err == std::ios_base::eofbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp
new file mode 100644
index 0000000..253fb2c
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp
@@ -0,0 +1,79 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get_byname<charT, InputIterator>
+
+// iter_type
+// get_weekday(iter_type s, iter_type end, ios_base& str,
+//             ios_base::iostate& err, tm* t) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const wchar_t*> I;
+
+typedef std::time_get_byname<wchar_t, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(const std::string& nm, std::size_t refs = 0)
+        : F(nm, refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const my_facet f("en_US", 1);
+        const wchar_t in[] = L"Monday";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_wday == 1);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("fr_FR", 1);
+        const wchar_t in[] = L"Lundi";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_wday == 1);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("ru_RU", 1);
+        const wchar_t in[] = L"\x43F\x43E\x43D\x435\x434\x435\x43B\x44C\x43D\x438\x43A";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_wday == 1);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("zh_CN", 1);
+        const wchar_t in[] = L"\x661F\x671F\x4E00";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_wday == 1);
+        assert(err == std::ios_base::eofbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get.byname/get_year.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_year.pass.cpp
new file mode 100644
index 0000000..1ac9118
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_year.pass.cpp
@@ -0,0 +1,78 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get_byname<charT, InputIterator>
+
+// iter_type get_year(iter_type s, iter_type end, ios_base& str, 
+//                    ios_base::iostate& err, tm* t) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const char*> I;
+
+typedef std::time_get_byname<char, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(const std::string& nm, std::size_t refs = 0)
+        : F(nm, refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const my_facet f("en_US", 1);
+        const char in[] = "2009";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_year(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_year == 109);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("fr_FR", 1);
+        const char in[] = "2009";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_year(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_year == 109);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("ru_RU", 1);
+        const char in[] = "2009";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_year(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_year == 109);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("zh_CN", 1);
+        const char in[] = "2009";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_year(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_year == 109);
+        assert(err == std::ios_base::eofbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get.byname/get_year_wide.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get.byname/get_year_wide.pass.cpp
new file mode 100644
index 0000000..6ad7943
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get.byname/get_year_wide.pass.cpp
@@ -0,0 +1,78 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get_byname<charT, InputIterator>
+
+// iter_type get_year(iter_type s, iter_type end, ios_base& str, 
+//                    ios_base::iostate& err, tm* t) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const wchar_t*> I;
+
+typedef std::time_get_byname<wchar_t, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(const std::string& nm, std::size_t refs = 0)
+        : F(nm, refs) {}
+};
+
+int main()
+{
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const my_facet f("en_US", 1);
+        const wchar_t in[] = L"2009";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_year(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_year == 109);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("fr_FR", 1);
+        const wchar_t in[] = L"2009";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_year(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_year == 109);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("ru_RU", 1);
+        const wchar_t in[] = L"2009";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_year(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_year == 109);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const my_facet f("zh_CN", 1);
+        const wchar_t in[] = L"2009";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_year(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_year == 109);
+        assert(err == std::ios_base::eofbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get.byname/iterators.h b/test/localization/locale.categories/category.time/locale.time.get.byname/iterators.h
new file mode 100644
index 0000000..5e3ff31
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get.byname/iterators.h
@@ -0,0 +1,55 @@
+#ifndef ITERATORS_H
+#define ITERATORS_H
+
+#include <iterator>
+
+template <class It>
+class input_iterator
+{
+    It it_;
+
+    template <class U> friend class input_iterator;
+public:
+    typedef          std::input_iterator_tag                   iterator_category;
+    typedef typename std::iterator_traits<It>::value_type      value_type;
+    typedef typename std::iterator_traits<It>::difference_type difference_type;
+    typedef It                                                 pointer;
+    typedef typename std::iterator_traits<It>::reference       reference;
+
+    It base() const {return it_;}
+
+    input_iterator() : it_() {}
+    explicit input_iterator(It it) : it_(it) {}
+    template <class U>
+        input_iterator(const input_iterator<U>& u) :it_(u.it_) {}
+
+    reference operator*() const {return *it_;}
+    pointer operator->() const {return it_;}
+
+    input_iterator& operator++() {++it_; return *this;}
+    input_iterator operator++(int)
+        {input_iterator tmp(*this); ++(*this); return tmp;}
+
+    friend bool operator==(const input_iterator& x, const input_iterator& y)
+        {return x.it_ == y.it_;}
+    friend bool operator!=(const input_iterator& x, const input_iterator& y)
+        {return !(x == y);}
+};
+
+template <class T, class U>
+inline
+bool
+operator==(const input_iterator<T>& x, const input_iterator<U>& y)
+{
+    return x.base() == y.base();
+}
+
+template <class T, class U>
+inline
+bool
+operator!=(const input_iterator<T>& x, const input_iterator<U>& y)
+{
+    return !(x == y);
+}
+
+#endif
diff --git a/test/localization/locale.categories/category.time/locale.time.get/ctor.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get/ctor.pass.cpp
new file mode 100644
index 0000000..388c00b
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get/ctor.pass.cpp
@@ -0,0 +1,52 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get<charT, InputIterator>
+
+// explicit time_get(size_t refs = 0);
+
+#include <locale>
+#include <cassert>
+
+typedef std::time_get<char, const char*> F;
+
+class my_facet
+    : public F
+{
+public:
+    static int count;
+
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {++count;}
+
+    ~my_facet() {--count;}
+};
+
+int my_facet::count = 0;
+
+int main()
+{
+    {
+        std::locale l(std::locale::classic(), new my_facet);
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f(1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/date_order.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/date_order.pass.cpp
new file mode 100644
index 0000000..2480bf9
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/date_order.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get<charT, InputIterator>
+
+// dateorder date_order() const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef std::time_get<char, input_iterator<const char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+int main()
+{
+    const my_facet f(1);
+    assert(f.date_order() == std::time_base::mdy);
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_date.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_date.pass.cpp
new file mode 100644
index 0000000..87f9e7a
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_date.pass.cpp
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get<charT, InputIterator>
+
+// iter_type
+// get_date(iter_type s, iter_type end, ios_base& str,
+//          ios_base::iostate& err, tm* t) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const char*> I;
+
+typedef std::time_get<char, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const char in[] = "5/5/5";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_date(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_mon == 4);
+        assert(t.tm_mday == 5);
+        assert(t.tm_year == 105);
+        assert(err == std::ios_base::eofbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_date_wide.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_date_wide.pass.cpp
new file mode 100644
index 0000000..c1ca59a
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_date_wide.pass.cpp
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get<charT, InputIterator>
+
+// iter_type
+// get_date(iter_type s, iter_type end, ios_base& str,
+//          ios_base::iostate& err, tm* t) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const wchar_t*> I;
+
+typedef std::time_get<wchar_t, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const wchar_t in[] = L"5/5/5";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_date(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_mon == 4);
+        assert(t.tm_mday == 5);
+        assert(t.tm_year == 105);
+        assert(err == std::ios_base::eofbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_many.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_many.pass.cpp
new file mode 100644
index 0000000..b5f8caa
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_many.pass.cpp
@@ -0,0 +1,68 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get<charT, InputIterator>
+
+// iter_type
+// get(iter_type s, iter_type end, ios_base& f, ios_base::iostate& err, tm *t,
+//     const char_type *fmt, const char_type *fmtend) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const char*> I;
+
+typedef std::time_get<char, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const char in[] = "2009 May 9, 10:27pm";
+        const char fmt[] = "%Y %b %d, %I:%M%p";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, fmt, fmt+sizeof(fmt)-1);
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_year == 109);
+        assert(t.tm_mon == 4);
+        assert(t.tm_mday == 9);
+        assert(t.tm_hour == 22);
+        assert(t.tm_min == 27);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "10:27PM May 9, 2009";
+        const char fmt[] = "%I:%M%p %b %d, %Y";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, fmt, fmt+sizeof(fmt)-1);
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_year == 109);
+        assert(t.tm_mon == 4);
+        assert(t.tm_mday == 9);
+        assert(t.tm_hour == 22);
+        assert(t.tm_min == 27);
+        assert(err == std::ios_base::eofbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_monthname.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_monthname.pass.cpp
new file mode 100644
index 0000000..0df8310
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_monthname.pass.cpp
@@ -0,0 +1,265 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get<charT, InputIterator>
+
+// iter_type
+// get_monthname(iter_type s, iter_type end, ios_base& str,
+//               ios_base::iostate& err, tm* t) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const char*> I;
+
+typedef std::time_get<char, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const char in[] = "Jan";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 0);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Feb";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 1);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Mar";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 2);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Apr";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 3);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "May";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 4);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Jun";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 5);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Jul";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 6);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Aug";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 7);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Sep";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 8);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Oct";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 9);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Nov";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 10);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Dec";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 11);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "January";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+7);
+        assert(t.tm_mon == 0);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "February";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+8);
+        assert(t.tm_mon == 1);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "March";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+5);
+        assert(t.tm_mon == 2);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "April";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+5);
+        assert(t.tm_mon == 3);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "May";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 4);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "June";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+4);
+        assert(t.tm_mon == 5);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "July";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+4);
+        assert(t.tm_mon == 6);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "August";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+6);
+        assert(t.tm_mon == 7);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "September";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+9);
+        assert(t.tm_mon == 8);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "October";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+7);
+        assert(t.tm_mon == 9);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "November";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+8);
+        assert(t.tm_mon == 10);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "December";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+8);
+        assert(t.tm_mon == 11);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Decemper";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+5);
+        assert(t.tm_mon == 0);
+        assert(err == std::ios_base::failbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_monthname_wide.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_monthname_wide.pass.cpp
new file mode 100644
index 0000000..bf90ddb
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_monthname_wide.pass.cpp
@@ -0,0 +1,265 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get<charT, InputIterator>
+
+// iter_type
+// get_monthname(iter_type s, iter_type end, ios_base& str,
+//               ios_base::iostate& err, tm* t) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const wchar_t*> I;
+
+typedef std::time_get<wchar_t, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const wchar_t in[] = L"Jan";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 0);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Feb";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 1);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Mar";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 2);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Apr";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 3);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"May";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 4);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Jun";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 5);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Jul";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 6);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Aug";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 7);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Sep";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 8);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Oct";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 9);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Nov";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 10);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Dec";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 11);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"January";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+7);
+        assert(t.tm_mon == 0);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"February";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+8);
+        assert(t.tm_mon == 1);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"March";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+5);
+        assert(t.tm_mon == 2);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"April";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+5);
+        assert(t.tm_mon == 3);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"May";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_mon == 4);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"June";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+4);
+        assert(t.tm_mon == 5);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"July";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+4);
+        assert(t.tm_mon == 6);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"August";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+6);
+        assert(t.tm_mon == 7);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"September";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+9);
+        assert(t.tm_mon == 8);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"October";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+7);
+        assert(t.tm_mon == 9);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"November";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+8);
+        assert(t.tm_mon == 10);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"December";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+8);
+        assert(t.tm_mon == 11);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Decemper";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_monthname(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+5);
+        assert(t.tm_mon == 0);
+        assert(err == std::ios_base::failbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_one.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_one.pass.cpp
new file mode 100644
index 0000000..a476778
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_one.pass.cpp
@@ -0,0 +1,305 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get<charT, InputIterator>
+
+// iter_type get(iter_type s, iter_type end, ios_base& f, 
+//               ios_base::iostate& err, tm *t, char format, char modifier = 0) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const char*> I;
+
+typedef std::time_get<char, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const char in[] = "mon";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'a');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_wday == 1);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "wednesdaY";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'A');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_wday == 3);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "June";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'b');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_mon == 5);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Jul";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'B');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_mon == 6);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Thu Jun  6 09:49:10 2009";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'c');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_wday == 4);
+        assert(t.tm_mon == 5);
+        assert(t.tm_mday == 6);
+        assert(t.tm_hour == 9);
+        assert(t.tm_min == 49);
+        assert(t.tm_sec == 10);
+        assert(t.tm_year == 109);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "11";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'd');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_mday == 11);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "2/1/1";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'D');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_mon == 1);
+        assert(t.tm_mday == 1);
+        assert(t.tm_year == 101);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "11";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'e');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_mday == 11);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "June";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'h');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_mon == 5);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "19";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'H');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_hour == 19);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "12";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'm');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_mon == 11);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "59";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'M');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_min == 59);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "\t\n ";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'n');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "09:49:10 PM";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'r');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_hour == 21);
+        assert(t.tm_min == 49);
+        assert(t.tm_sec == 10);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "09:49:10 AM";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'r');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_hour == 9);
+        assert(t.tm_min == 49);
+        assert(t.tm_sec == 10);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "12:49:10 AM";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'r');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_hour == 0);
+        assert(t.tm_min == 49);
+        assert(t.tm_sec == 10);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "12:49:10 PM";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'r');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_hour == 12);
+        assert(t.tm_min == 49);
+        assert(t.tm_sec == 10);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "09:49";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'R');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_hour == 9);
+        assert(t.tm_min == 49);
+        assert(t.tm_sec == 0);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "60";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'S');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_hour == 0);
+        assert(t.tm_min == 0);
+        assert(t.tm_sec == 60);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "\t\n ";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 't');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "21:49:10";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'T');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_hour == 21);
+        assert(t.tm_min == 49);
+        assert(t.tm_sec == 10);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "3";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'w');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_wday == 3);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "06/06/09";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'x');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_mon == 5);
+        assert(t.tm_mday == 6);
+        assert(t.tm_year == 109);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "21:49:10";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'X');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_hour == 21);
+        assert(t.tm_min == 49);
+        assert(t.tm_sec == 10);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "68";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'y');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_year == 168);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "68";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, 'Y');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_year == -1832);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "%";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get(I(in), I(in+sizeof(in)-1), ios, err, &t, '%');
+        assert(i.base() == in+sizeof(in)-1);
+        assert(err == std::ios_base::eofbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_time.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_time.pass.cpp
new file mode 100644
index 0000000..843d04e
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_time.pass.cpp
@@ -0,0 +1,117 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get<charT, InputIterator>
+
+// iter_type
+// get_time(iter_type s, iter_type end, ios_base& str,
+//          ios_base::iostate& err, tm* t) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const char*> I;
+
+typedef std::time_get<char, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const char in[] = "0:0:0";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_hour == 0);
+        assert(t.tm_min == 0);
+        assert(t.tm_sec == 0);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "23:59:60";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_hour == 23);
+        assert(t.tm_min == 59);
+        assert(t.tm_sec == 60);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "24:59:60";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+2);
+        assert(t.tm_hour == 0);
+        assert(t.tm_min == 0);
+        assert(t.tm_sec == 0);
+        assert(err == std::ios_base::failbit);
+    }
+    {
+        const char in[] = "23:60:60";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+5);
+//         assert(t.tm_hour == 0);
+//         assert(t.tm_min == 0);
+//         assert(t.tm_sec == 0);
+        assert(err == std::ios_base::failbit);
+    }
+    {
+        const char in[] = "23:59:61";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+8);
+//         assert(t.tm_hour == 0);
+//         assert(t.tm_min == 0);
+//         assert(t.tm_sec == 0);
+        assert(err == (std::ios_base::failbit | std::ios_base::eofbit));
+    }
+    {
+        const char in[] = "2:43:221";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+7);
+        assert(t.tm_hour == 2);
+        assert(t.tm_min == 43);
+        assert(t.tm_sec == 22);
+        assert(err == std::ios_base::goodbit);
+    }
+    {
+        const char in[] = "2.43:221";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+1);
+//         assert(t.tm_hour == 0);
+//         assert(t.tm_min == 0);
+//         assert(t.tm_sec == 0);
+        assert(err == std::ios_base::failbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_time_wide.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_time_wide.pass.cpp
new file mode 100644
index 0000000..0b74804
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_time_wide.pass.cpp
@@ -0,0 +1,117 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get<charT, InputIterator>
+
+// iter_type
+// get_time(iter_type s, iter_type end, ios_base& str,
+//          ios_base::iostate& err, tm* t) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const wchar_t*> I;
+
+typedef std::time_get<wchar_t, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const wchar_t in[] = L"0:0:0";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_hour == 0);
+        assert(t.tm_min == 0);
+        assert(t.tm_sec == 0);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"23:59:60";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)/sizeof(in[0])-1);
+        assert(t.tm_hour == 23);
+        assert(t.tm_min == 59);
+        assert(t.tm_sec == 60);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"24:59:60";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+2);
+        assert(t.tm_hour == 0);
+        assert(t.tm_min == 0);
+        assert(t.tm_sec == 0);
+        assert(err == std::ios_base::failbit);
+    }
+    {
+        const wchar_t in[] = L"23:60:60";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+5);
+//         assert(t.tm_hour == 0);
+//         assert(t.tm_min == 0);
+//         assert(t.tm_sec == 0);
+        assert(err == std::ios_base::failbit);
+    }
+    {
+        const wchar_t in[] = L"23:59:61";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+8);
+//         assert(t.tm_hour == 0);
+//         assert(t.tm_min == 0);
+//         assert(t.tm_sec == 0);
+        assert(err == (std::ios_base::failbit | std::ios_base::eofbit));
+    }
+    {
+        const wchar_t in[] = L"2:43:221";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+7);
+        assert(t.tm_hour == 2);
+        assert(t.tm_min == 43);
+        assert(t.tm_sec == 22);
+        assert(err == std::ios_base::goodbit);
+    }
+    {
+        const wchar_t in[] = L"2.43:221";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_time(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+1);
+//         assert(t.tm_hour == 0);
+//         assert(t.tm_min == 0);
+//         assert(t.tm_sec == 0);
+        assert(err == std::ios_base::failbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_weekday.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_weekday.pass.cpp
new file mode 100644
index 0000000..d125f10
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_weekday.pass.cpp
@@ -0,0 +1,220 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get<charT, InputIterator>
+
+// iter_type
+// get_weekday(iter_type s, iter_type end, ios_base& str,
+//             ios_base::iostate& err, tm* t) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const char*> I;
+
+typedef std::time_get<char, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const char in[] = "Sun";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 0);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Suny";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 0);
+        assert(err == std::ios_base::goodbit);
+    }
+    {
+        const char in[] = "Sund";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+4);
+        assert(t.tm_wday == 0);
+        assert(err == (std::ios_base::failbit | std::ios_base::eofbit));
+    }
+    {
+        const char in[] = "sun";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 0);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "sunday";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+6);
+        assert(t.tm_wday == 0);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Mon";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 1);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Mony";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 1);
+        assert(err == std::ios_base::goodbit);
+    }
+    {
+        const char in[] = "Mond";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+4);
+        assert(t.tm_wday == 0);
+        assert(err == (std::ios_base::failbit | std::ios_base::eofbit));
+    }
+    {
+        const char in[] = "mon";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 1);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "monday";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+6);
+        assert(t.tm_wday == 1);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Tue";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 2);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Tuesday";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+7);
+        assert(t.tm_wday == 2);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Wed";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 3);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Wednesday";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+9);
+        assert(t.tm_wday == 3);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Thu";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 4);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Thursday";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+8);
+        assert(t.tm_wday == 4);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Fri";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 5);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Friday";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+6);
+        assert(t.tm_wday == 5);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Sat";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 6);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "Saturday";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+8);
+        assert(t.tm_wday == 6);
+        assert(err == std::ios_base::eofbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_weekday_wide.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_weekday_wide.pass.cpp
new file mode 100644
index 0000000..cb79313
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_weekday_wide.pass.cpp
@@ -0,0 +1,220 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get<charT, InputIterator>
+
+// iter_type
+// get_weekday(iter_type s, iter_type end, ios_base& str,
+//             ios_base::iostate& err, tm* t) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const wchar_t*> I;
+
+typedef std::time_get<wchar_t, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const wchar_t in[] = L"Sun";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 0);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Suny";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 0);
+        assert(err == std::ios_base::goodbit);
+    }
+    {
+        const wchar_t in[] = L"Sund";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+4);
+        assert(t.tm_wday == 0);
+        assert(err == (std::ios_base::failbit | std::ios_base::eofbit));
+    }
+    {
+        const wchar_t in[] = L"sun";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 0);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"sunday";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+6);
+        assert(t.tm_wday == 0);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Mon";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 1);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Mony";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 1);
+        assert(err == std::ios_base::goodbit);
+    }
+    {
+        const wchar_t in[] = L"Mond";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+4);
+        assert(t.tm_wday == 0);
+        assert(err == (std::ios_base::failbit | std::ios_base::eofbit));
+    }
+    {
+        const wchar_t in[] = L"mon";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 1);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"monday";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+6);
+        assert(t.tm_wday == 1);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Tue";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 2);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Tuesday";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+7);
+        assert(t.tm_wday == 2);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Wed";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 3);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Wednesday";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+9);
+        assert(t.tm_wday == 3);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Thu";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 4);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Thursday";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+8);
+        assert(t.tm_wday == 4);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Fri";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 5);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Friday";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+6);
+        assert(t.tm_wday == 5);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Sat";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+3);
+        assert(t.tm_wday == 6);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const wchar_t in[] = L"Saturday";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
+        assert(i.base() == in+8);
+        assert(t.tm_wday == 6);
+        assert(err == std::ios_base::eofbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_year.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_year.pass.cpp
new file mode 100644
index 0000000..168a435
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_year.pass.cpp
@@ -0,0 +1,138 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_get<charT, InputIterator>
+
+// iter_type get_year(iter_type s, iter_type end, ios_base& str, 
+//                    ios_base::iostate& err, tm* t) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef input_iterator<const char*> I;
+
+typedef std::time_get<char, I> F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+int main()
+{
+    const my_facet f(1);
+    std::ios ios(0);
+    std::ios_base::iostate err;
+    std::tm t;
+    {
+        const char in[] = "0";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_year(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_year == 100);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "00";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_year(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_year == 100);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "1";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_year(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_year == 101);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "68";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_year(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_year == 168);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "69";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_year(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_year == 69);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "99";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_year(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_year == 99);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "100";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_year(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_year == -1800);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "1900";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_year(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_year == 0);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "1968";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_year(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_year == 68);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "2000";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_year(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)-1);
+        assert(t.tm_year == 100);
+        assert(err == std::ios_base::eofbit);
+    }
+    {
+        const char in[] = "2999c";
+        err = std::ios_base::goodbit;
+        t = std::tm();
+        I i = f.get_year(I(in), I(in+sizeof(in)-1), ios, err, &t);
+        assert(i.base() == in+sizeof(in)-2);
+        assert(t.tm_year == 1099);
+        assert(err == std::ios_base::goodbit);
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/iterators.h b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/iterators.h
new file mode 100644
index 0000000..5e3ff31
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/iterators.h
@@ -0,0 +1,55 @@
+#ifndef ITERATORS_H
+#define ITERATORS_H
+
+#include <iterator>
+
+template <class It>
+class input_iterator
+{
+    It it_;
+
+    template <class U> friend class input_iterator;
+public:
+    typedef          std::input_iterator_tag                   iterator_category;
+    typedef typename std::iterator_traits<It>::value_type      value_type;
+    typedef typename std::iterator_traits<It>::difference_type difference_type;
+    typedef It                                                 pointer;
+    typedef typename std::iterator_traits<It>::reference       reference;
+
+    It base() const {return it_;}
+
+    input_iterator() : it_() {}
+    explicit input_iterator(It it) : it_(it) {}
+    template <class U>
+        input_iterator(const input_iterator<U>& u) :it_(u.it_) {}
+
+    reference operator*() const {return *it_;}
+    pointer operator->() const {return it_;}
+
+    input_iterator& operator++() {++it_; return *this;}
+    input_iterator operator++(int)
+        {input_iterator tmp(*this); ++(*this); return tmp;}
+
+    friend bool operator==(const input_iterator& x, const input_iterator& y)
+        {return x.it_ == y.it_;}
+    friend bool operator!=(const input_iterator& x, const input_iterator& y)
+        {return !(x == y);}
+};
+
+template <class T, class U>
+inline
+bool
+operator==(const input_iterator<T>& x, const input_iterator<U>& y)
+{
+    return x.base() == y.base();
+}
+
+template <class T, class U>
+inline
+bool
+operator!=(const input_iterator<T>& x, const input_iterator<U>& y)
+{
+    return !(x == y);
+}
+
+#endif
diff --git a/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.virtuals/tested_elsewhere.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.virtuals/tested_elsewhere.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get/locale.time.get.virtuals/tested_elsewhere.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get/time_base.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get/time_base.pass.cpp
new file mode 100644
index 0000000..af65a86
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get/time_base.pass.cpp
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_base
+// {
+// public:
+//     enum dateorder {no_order, dmy, mdy, ymd, ydm};
+// };
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::time_base::dateorder d = std::time_base::no_order;
+    assert(std::time_base::no_order == 0);
+    assert(std::time_base::dmy == 1);
+    assert(std::time_base::mdy == 2);
+    assert(std::time_base::ymd == 3);
+    assert(std::time_base::ydm == 4);
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.get/types.pass.cpp b/test/localization/locale.categories/category.time/locale.time.get/types.pass.cpp
new file mode 100644
index 0000000..e6268fa
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.get/types.pass.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_base
+// {
+// public:
+//     enum dateorder {no_order, dmy, mdy, ymd, ydm};
+// };
+// 
+// template <class charT, class InputIterator = istreambuf_iterator<charT> > 
+// class time_get
+//     : public locale::facet,
+//       public time_base
+// {
+// public: 
+//     typedef charT         char_type; 
+//     typedef InputIterator iter_type;
+
+#include <locale>
+#include <iterator>
+#include <type_traits>
+
+int main()
+{
+    static_assert((std::is_base_of<std::locale::facet, std::time_get<char> >::value), "");
+    static_assert((std::is_base_of<std::locale::facet, std::time_get<wchar_t> >::value), "");
+    static_assert((std::is_base_of<std::time_base, std::time_get<char> >::value), "");
+    static_assert((std::is_base_of<std::time_base, std::time_get<wchar_t> >::value), "");
+    static_assert((std::is_same<std::time_get<char>::char_type, char>::value), "");
+    static_assert((std::is_same<std::time_get<wchar_t>::char_type, wchar_t>::value), "");
+    static_assert((std::is_same<std::time_get<char>::iter_type, std::istreambuf_iterator<char> >::value), "");
+    static_assert((std::is_same<std::time_get<wchar_t>::iter_type, std::istreambuf_iterator<wchar_t> >::value), "");
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.put.byname/iterators.h b/test/localization/locale.categories/category.time/locale.time.put.byname/iterators.h
new file mode 100644
index 0000000..791e416
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.put.byname/iterators.h
@@ -0,0 +1,33 @@
+#ifndef ITERATORS_H
+#define ITERATORS_H
+
+#include <iterator>
+
+template <class It>
+class output_iterator
+{
+    It it_;
+
+    template <class U> friend class output_iterator;
+public:
+    typedef          std::output_iterator_tag                  iterator_category;
+    typedef typename std::iterator_traits<It>::value_type      value_type;
+    typedef typename std::iterator_traits<It>::difference_type difference_type;
+    typedef It                                                 pointer;
+    typedef typename std::iterator_traits<It>::reference       reference;
+
+    It base() const {return it_;}
+
+    output_iterator() : it_() {}
+    explicit output_iterator(It it) : it_(it) {}
+    template <class U>
+        output_iterator(const output_iterator<U>& u) :it_(u.it_) {}
+
+    reference operator*() const {return *it_;}
+
+    output_iterator& operator++() {++it_; return *this;}
+    output_iterator operator++(int)
+        {output_iterator tmp(*this); ++(*this); return tmp;}
+};
+
+#endif
diff --git a/test/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp b/test/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp
new file mode 100644
index 0000000..9f1640b
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp
@@ -0,0 +1,69 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class CharT, class OutputIterator = ostreambuf_iterator<CharT> >
+// class time_put_byname
+//     : public time_put<CharT, OutputIterator>
+// {
+// public:
+//     explicit time_put_byname(const char* nm, size_t refs = 0);
+//     explicit time_put_byname(const string& nm, size_t refs = 0);
+// 
+// protected:
+//     ~time_put_byname();
+// };
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef std::time_put_byname<char, output_iterator<char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(const std::string& nm, std::size_t refs = 0)
+        : F(nm, refs) {}
+};
+
+int main()
+{
+    char str[200];
+    output_iterator<char*> iter;
+    tm t;
+    t.tm_sec = 6;
+    t.tm_min = 3;
+    t.tm_hour = 13;
+    t.tm_mday = 2;
+    t.tm_mon = 4;
+    t.tm_year = 109;
+    t.tm_wday = 6;
+    t.tm_yday = -1;
+    t.tm_isdst = 1;
+    std::ios ios(0);
+    {
+        const my_facet f("en_US", 1);
+        std::string pat("Today is %A which is abreviated %a.");
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t,
+                     pat.data(), pat.data() + pat.size());
+        std::string ex(str, iter.base());
+        assert(ex == "Today is Saturday which is abreviated Sat.");
+    }
+    {
+        const my_facet f("fr_FR", 1);
+        std::string pat("Today is %A which is abreviated %a.");
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t,
+                     pat.data(), pat.data() + pat.size());
+        std::string ex(str, iter.base());
+        assert(ex == "Today is Samedi which is abreviated Sam.");
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.put/ctor.pass.cpp b/test/localization/locale.categories/category.time/locale.time.put/ctor.pass.cpp
new file mode 100644
index 0000000..713a956
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.put/ctor.pass.cpp
@@ -0,0 +1,52 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_put<charT, OutputIterator>
+
+// explicit time_put(size_t refs = 0);
+
+#include <locale>
+#include <cassert>
+
+typedef std::time_put<char, char*> F;
+
+class my_facet
+    : public F
+{
+public:
+    static int count;
+
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {++count;}
+
+    ~my_facet() {--count;}
+};
+
+int my_facet::count = 0;
+
+int main()
+{
+    {
+        std::locale l(std::locale::classic(), new my_facet);
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+    {
+        my_facet f(1);
+        assert(my_facet::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet::count == 1);
+        }
+        assert(my_facet::count == 1);
+    }
+    assert(my_facet::count == 0);
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.put/locale.time.put.members/iterators.h b/test/localization/locale.categories/category.time/locale.time.put/locale.time.put.members/iterators.h
new file mode 100644
index 0000000..791e416
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.put/locale.time.put.members/iterators.h
@@ -0,0 +1,33 @@
+#ifndef ITERATORS_H
+#define ITERATORS_H
+
+#include <iterator>
+
+template <class It>
+class output_iterator
+{
+    It it_;
+
+    template <class U> friend class output_iterator;
+public:
+    typedef          std::output_iterator_tag                  iterator_category;
+    typedef typename std::iterator_traits<It>::value_type      value_type;
+    typedef typename std::iterator_traits<It>::difference_type difference_type;
+    typedef It                                                 pointer;
+    typedef typename std::iterator_traits<It>::reference       reference;
+
+    It base() const {return it_;}
+
+    output_iterator() : it_() {}
+    explicit output_iterator(It it) : it_(it) {}
+    template <class U>
+        output_iterator(const output_iterator<U>& u) :it_(u.it_) {}
+
+    reference operator*() const {return *it_;}
+
+    output_iterator& operator++() {++it_; return *this;}
+    output_iterator operator++(int)
+        {output_iterator tmp(*this); ++(*this); return tmp;}
+};
+
+#endif
diff --git a/test/localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put1.pass.cpp b/test/localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put1.pass.cpp
new file mode 100644
index 0000000..d67314a
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put1.pass.cpp
@@ -0,0 +1,61 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_put<charT, OutputIterator>
+
+// iter_type put(iter_type s, ios_base& str, char_type fill, const tm* t, 
+//               const charT* pattern, const charT* pat_end) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef std::time_put<char, output_iterator<char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+int main()
+{
+    const my_facet f(1);
+    char str[200];
+    output_iterator<char*> iter;
+    tm t;
+    t.tm_sec = 6;
+    t.tm_min = 3;
+    t.tm_hour = 13;
+    t.tm_mday = 2;
+    t.tm_mon = 4;
+    t.tm_year = 109;
+    t.tm_wday = 6;
+    t.tm_yday = -1;
+    t.tm_isdst = 1;
+    std::ios ios(0);
+    {
+        std::string pat("Today is %A which is abreviated %a.");
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t,
+                     pat.data(), pat.data() + pat.size());
+        std::string ex(str, iter.base());
+        assert(ex == "Today is Saturday which is abreviated Sat.");
+    }
+    {
+        std::string pat("The number of the month is %Om.");
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t,
+                     pat.data(), pat.data() + pat.size());
+        std::string ex(str, iter.base());
+        assert(ex == "The number of the month is 05.");
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put2.pass.cpp b/test/localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put2.pass.cpp
new file mode 100644
index 0000000..ff3a3dd
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put2.pass.cpp
@@ -0,0 +1,367 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class time_put<charT, OutputIterator>
+
+// iter_type put(iter_type s, ios_base& str, char_type fill, const tm* t, 
+//               char format, char modifier = 0) const;
+
+#include <locale>
+#include <cassert>
+#include "iterators.h"
+
+typedef std::time_put<char, output_iterator<char*> > F;
+
+class my_facet
+    : public F
+{
+public:
+    explicit my_facet(std::size_t refs = 0)
+        : F(refs) {}
+};
+
+int main()
+{
+    const my_facet f(1);
+    char str[200];
+    output_iterator<char*> iter;
+    tm t;
+    t.tm_sec = 6;
+    t.tm_min = 3;
+    t.tm_hour = 13;
+    t.tm_mday = 2;
+    t.tm_mon = 4;
+    t.tm_year = 109;
+    t.tm_wday = 6;
+    t.tm_yday = -1;
+    t.tm_isdst = 1;
+    std::ios ios(0);
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'A');
+        std::string ex(str, iter.base());
+        assert(ex == "Saturday");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'a');
+        std::string ex(str, iter.base());
+        assert(ex == "Sat");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'B');
+        std::string ex(str, iter.base());
+        assert(ex == "May");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'b');
+        std::string ex(str, iter.base());
+        assert(ex == "May");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'C');
+        std::string ex(str, iter.base());
+        assert(ex == "20");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'c');
+        std::string ex(str, iter.base());
+        assert(ex == "Sat May  2 13:03:06 2009");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'D');
+        std::string ex(str, iter.base());
+        assert(ex == "05/02/09");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'd');
+        std::string ex(str, iter.base());
+        assert(ex == "02");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'c', 'E');
+        std::string ex(str, iter.base());
+        assert(ex == "Sat May  2 13:03:06 2009");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'C', 'E');
+        std::string ex(str, iter.base());
+        assert(ex == "20");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'x', 'E');
+        std::string ex(str, iter.base());
+        assert(ex == "05/02/09");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'X', 'E');
+        std::string ex(str, iter.base());
+        assert(ex == "13:03:06");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'y', 'E');
+        std::string ex(str, iter.base());
+        assert(ex == "09");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'Y', 'E');
+        std::string ex(str, iter.base());
+        assert(ex == "2009");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'd', 'O');
+        std::string ex(str, iter.base());
+        assert(ex == "02");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'e', 'O');
+        std::string ex(str, iter.base());
+        assert(ex == " 2");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'H', 'O');
+        std::string ex(str, iter.base());
+        assert(ex == "13");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'I', 'O');
+        std::string ex(str, iter.base());
+        assert(ex == "01");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'm', 'O');
+        std::string ex(str, iter.base());
+        assert(ex == "05");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'M', 'O');
+        std::string ex(str, iter.base());
+        assert(ex == "03");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'S', 'O');
+        std::string ex(str, iter.base());
+        assert(ex == "06");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'u', 'O');
+        std::string ex(str, iter.base());
+        assert(ex == "6");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'U', 'O');
+        std::string ex(str, iter.base());
+        assert(ex == "00");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'V', 'O');
+        std::string ex(str, iter.base());
+        assert(ex == "52");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'w', 'O');
+        std::string ex(str, iter.base());
+        assert(ex == "6");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'W', 'O');
+        std::string ex(str, iter.base());
+        assert(ex == "00");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'y', 'O');
+        std::string ex(str, iter.base());
+        assert(ex == "09");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'B', 'O');
+        std::string ex(str, iter.base());
+        assert(ex == "May");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'e');
+        std::string ex(str, iter.base());
+        assert(ex == " 2");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'F');
+        std::string ex(str, iter.base());
+        assert(ex == "2009-05-02");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'G');
+        std::string ex(str, iter.base());
+        assert(ex == "2008");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'g');
+        std::string ex(str, iter.base());
+        assert(ex == "08");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'H');
+        std::string ex(str, iter.base());
+        assert(ex == "13");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'h');
+        std::string ex(str, iter.base());
+        assert(ex == "May");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'I');
+        std::string ex(str, iter.base());
+        assert(ex == "01");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'j');
+        std::string ex(str, iter.base());
+        assert(ex == "000");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'k');
+        std::string ex(str, iter.base());
+        assert(ex == "13");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'l');
+        std::string ex(str, iter.base());
+        assert(ex == " 1");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'M');
+        std::string ex(str, iter.base());
+        assert(ex == "03");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'm');
+        std::string ex(str, iter.base());
+        assert(ex == "05");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'n');
+        std::string ex(str, iter.base());
+        assert(ex == "\n");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'p');
+        std::string ex(str, iter.base());
+        assert(ex == "PM");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'R');
+        std::string ex(str, iter.base());
+        assert(ex == "13:03");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'r');
+        std::string ex(str, iter.base());
+        assert(ex == "01:03:06 PM");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'S');
+        std::string ex(str, iter.base());
+        assert(ex == "06");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 's');
+        std::string ex(str, iter.base());
+//        assert(ex == "1241283786");  depends on time zone
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'T');
+        std::string ex(str, iter.base());
+        assert(ex == "13:03:06");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 't');
+        std::string ex(str, iter.base());
+        assert(ex == "\t");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'U');
+        std::string ex(str, iter.base());
+        assert(ex == "00");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'u');
+        std::string ex(str, iter.base());
+        assert(ex == "6");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'V');
+        std::string ex(str, iter.base());
+        assert(ex == "52");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'v');
+        std::string ex(str, iter.base());
+        assert(ex == " 2-May-2009");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'W');
+        std::string ex(str, iter.base());
+        assert(ex == "00");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'w');
+        std::string ex(str, iter.base());
+        assert(ex == "6");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'X');
+        std::string ex(str, iter.base());
+        assert(ex == "13:03:06");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'x');
+        std::string ex(str, iter.base());
+        assert(ex == "05/02/09");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'Y');
+        std::string ex(str, iter.base());
+        assert(ex == "2009");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'y');
+        std::string ex(str, iter.base());
+        assert(ex == "09");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'Z');
+        std::string ex(str, iter.base());
+//        assert(ex == "EDT");  depends on time zone
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'z');
+        std::string ex(str, iter.base());
+//        assert(ex == "-0400");  depends on time zone
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, '+');
+        std::string ex(str, iter.base());
+//        assert(ex == "Sat May  2 13:03:06 EDT 2009");  depends on time zone
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, '%');
+        std::string ex(str, iter.base());
+        assert(ex == "%");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, '%', 'J');
+        std::string ex(str, iter.base());
+        assert(ex == "J%");
+    }
+    {
+        iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'J');
+        std::string ex(str, iter.base());
+        assert(ex == "J");
+    }
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.put/locale.time.put.virtuals/tested_elsewhere.pass.cpp b/test/localization/locale.categories/category.time/locale.time.put/locale.time.put.virtuals/tested_elsewhere.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.put/locale.time.put.virtuals/tested_elsewhere.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/category.time/locale.time.put/types.pass.cpp b/test/localization/locale.categories/category.time/locale.time.put/types.pass.cpp
new file mode 100644
index 0000000..3eaa76f
--- /dev/null
+++ b/test/localization/locale.categories/category.time/locale.time.put/types.pass.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT, class OutputIterator = ostreambuf_iterator<charT> > 
+// class time_put
+//     : public locale::facet
+// {
+// public: 
+//     typedef charT          char_type; 
+//     typedef OutputIterator iter_type;
+
+#include <locale>
+#include <iterator>
+#include <type_traits>
+
+int main()
+{
+    static_assert((std::is_base_of<std::locale::facet, std::time_put<char> >::value), "");
+    static_assert((std::is_base_of<std::locale::facet, std::time_put<wchar_t> >::value), "");
+    static_assert((std::is_same<std::time_put<char>::char_type, char>::value), "");
+    static_assert((std::is_same<std::time_put<wchar_t>::char_type, wchar_t>::value), "");
+    static_assert((std::is_same<std::time_put<char>::iter_type, std::ostreambuf_iterator<char> >::value), "");
+    static_assert((std::is_same<std::time_put<wchar_t>::iter_type, std::ostreambuf_iterator<wchar_t> >::value), "");
+}
diff --git a/test/localization/locale.categories/category.time/nothing_to_do.pass.cpp b/test/localization/locale.categories/category.time/nothing_to_do.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/category.time/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/decimal_point.pass.cpp b/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/decimal_point.pass.cpp
new file mode 100644
index 0000000..bd2fcc6
--- /dev/null
+++ b/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/decimal_point.pass.cpp
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class numpunct_byname;
+
+// char_type decimal_point() const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    {
+        std::locale l("C");
+        {
+            typedef char C;
+            const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+            assert(np.decimal_point() == '.');
+        }
+        {
+            typedef wchar_t C;
+            const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+            assert(np.decimal_point() == L'.');
+        }
+    }
+    {
+        std::locale l("en_US");
+        {
+            typedef char C;
+            const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+            assert(np.decimal_point() == '.');
+        }
+        {
+            typedef wchar_t C;
+            const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+            assert(np.decimal_point() == L'.');
+        }
+    }
+    {
+        std::locale l("fr_FR");
+        {
+            typedef char C;
+            const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+            assert(np.decimal_point() == ',');
+        }
+        {
+            typedef wchar_t C;
+            const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+            assert(np.decimal_point() == L',');
+        }
+    }
+}
diff --git a/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp b/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
new file mode 100644
index 0000000..8d91c34
--- /dev/null
+++ b/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class numpunct_byname;
+
+// string grouping() const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    {
+        std::locale l("C");
+        {
+            typedef char C;
+            const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+            assert(np.grouping() == "");
+        }
+        {
+            typedef wchar_t C;
+            const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+            assert(np.grouping() == "");
+        }
+    }
+    {
+        std::locale l("en_US");
+        {
+            typedef char C;
+            const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+            assert(np.grouping() == "\3\3");
+        }
+        {
+            typedef wchar_t C;
+            const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+            assert(np.grouping() == "\3\3");
+        }
+    }
+    {
+        std::locale l("fr_FR");
+        {
+            typedef char C;
+            const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+            assert(np.grouping() == "\x7F");
+        }
+        {
+            typedef wchar_t C;
+            const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+            assert(np.grouping() == "\x7F");
+        }
+    }
+}
diff --git a/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp b/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
new file mode 100644
index 0000000..ff46d67
--- /dev/null
+++ b/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class numpunct_byname;
+
+// char_type thousands_sep() const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    {
+        std::locale l("C");
+        {
+            typedef char C;
+            const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+            assert(np.thousands_sep() == ',');
+        }
+        {
+            typedef wchar_t C;
+            const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+            assert(np.thousands_sep() == L',');
+        }
+    }
+    {
+        std::locale l("en_US");
+        {
+            typedef char C;
+            const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+            assert(np.thousands_sep() == ',');
+        }
+        {
+            typedef wchar_t C;
+            const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+            assert(np.thousands_sep() == L',');
+        }
+    }
+    {
+        std::locale l("fr_FR");
+        {
+            typedef char C;
+            const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+            assert(np.thousands_sep() == ',');
+        }
+        {
+            typedef wchar_t C;
+            const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+            assert(np.thousands_sep() == L',');
+        }
+    }
+}
diff --git a/test/localization/locale.categories/facet.numpunct/locale.numpunct/ctor.pass.cpp b/test/localization/locale.categories/facet.numpunct/locale.numpunct/ctor.pass.cpp
new file mode 100644
index 0000000..b6ea246
--- /dev/null
+++ b/test/localization/locale.categories/facet.numpunct/locale.numpunct/ctor.pass.cpp
@@ -0,0 +1,66 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class numpunct;
+
+// explicit numpunct(size_t refs = 0);
+
+#include <locale>
+#include <cassert>
+
+template <class C>
+class my_facet
+    : public std::numpunct<C>
+{
+public:
+    static int count;
+
+    explicit my_facet(std::size_t refs = 0)
+        : std::numpunct<C>(refs) {++count;}
+
+    ~my_facet() {--count;}
+};
+
+template <class C> int my_facet<C>::count = 0;
+
+int main()
+{
+    {
+        std::locale l(std::locale::classic(), new my_facet<char>);
+        assert(my_facet<char>::count == 1);
+    }
+    assert(my_facet<char>::count == 0);
+    {
+        my_facet<char> f(1);
+        assert(my_facet<char>::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet<char>::count == 1);
+        }
+        assert(my_facet<char>::count == 1);
+    }
+    assert(my_facet<char>::count == 0);
+    {
+        std::locale l(std::locale::classic(), new my_facet<wchar_t>);
+        assert(my_facet<wchar_t>::count == 1);
+    }
+    assert(my_facet<wchar_t>::count == 0);
+    {
+        my_facet<wchar_t> f(1);
+        assert(my_facet<wchar_t>::count == 1);
+        {
+            std::locale l(std::locale::classic(), &f);
+            assert(my_facet<wchar_t>::count == 1);
+        }
+        assert(my_facet<wchar_t>::count == 1);
+    }
+    assert(my_facet<wchar_t>::count == 0);
+}
diff --git a/test/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/decimal_point.pass.cpp b/test/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/decimal_point.pass.cpp
new file mode 100644
index 0000000..eecb395
--- /dev/null
+++ b/test/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/decimal_point.pass.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class numpunct;
+
+// char_type decimal_point() const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef char C;
+        const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+        assert(np.decimal_point() == '.');
+    }
+    {
+        typedef wchar_t C;
+        const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+        assert(np.decimal_point() == L'.');
+    }
+}
diff --git a/test/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/falsename.pass.cpp b/test/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/falsename.pass.cpp
new file mode 100644
index 0000000..8069463
--- /dev/null
+++ b/test/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/falsename.pass.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class numpunct;
+
+// string_type falsename() const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef char C;
+        const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+        assert(np.falsename() == std::string("false"));
+    }
+    {
+        typedef wchar_t C;
+        const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+        assert(np.falsename() == std::wstring(L"false"));
+    }
+}
diff --git a/test/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/grouping.pass.cpp b/test/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/grouping.pass.cpp
new file mode 100644
index 0000000..604e0c5
--- /dev/null
+++ b/test/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/grouping.pass.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class numpunct;
+
+// string grouping() const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef char C;
+        const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+        assert(np.grouping() == std::string());
+    }
+    {
+        typedef wchar_t C;
+        const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+        assert(np.grouping() == std::string());
+    }
+}
diff --git a/test/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/thousands_sep.pass.cpp b/test/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/thousands_sep.pass.cpp
new file mode 100644
index 0000000..37abfc5
--- /dev/null
+++ b/test/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/thousands_sep.pass.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class numpunct;
+
+// char_type thousands_sep() const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef char C;
+        const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+        assert(np.thousands_sep() == ',');
+    }
+    {
+        typedef wchar_t C;
+        const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+        assert(np.thousands_sep() == L',');
+    }
+}
diff --git a/test/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/truename.pass.cpp b/test/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/truename.pass.cpp
new file mode 100644
index 0000000..2f1b4ab
--- /dev/null
+++ b/test/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/truename.pass.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> class numpunct;
+
+// string_type truename() const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        typedef char C;
+        const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+        assert(np.truename() == std::string("true"));
+    }
+    {
+        typedef wchar_t C;
+        const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
+        assert(np.truename() == std::wstring(L"true"));
+    }
+}
diff --git a/test/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.virtuals/tested_elsewhere.pass.cpp b/test/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.virtuals/tested_elsewhere.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.virtuals/tested_elsewhere.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp b/test/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp
new file mode 100644
index 0000000..d7b6419
--- /dev/null
+++ b/test/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp
@@ -0,0 +1,48 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> 
+// class numpunct
+//     : public locale::facet
+// { 
+// public: 
+//     typedef charT char_type; 
+//     typedef basic_string<charT> string_type; 
+//     static locale::id id;
+
+#include <locale>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    std::locale l = std::locale::classic();
+    {
+        assert(std::has_facet<std::numpunct<char> >(l));
+        const std::numpunct<char>& f = std::use_facet<std::numpunct<char> >(l);
+        {
+            (void)std::numpunct<char>::id;
+        }
+        static_assert((std::is_same<std::numpunct<char>::char_type, char>::value), "");
+        static_assert((std::is_same<std::numpunct<char>::string_type, std::string>::value), "");
+        static_assert((std::is_base_of<std::locale::facet, std::numpunct<char> >::value), "");
+    }
+    {
+        assert(std::has_facet<std::numpunct<wchar_t> >(l));
+        const std::numpunct<wchar_t>& f = std::use_facet<std::numpunct<wchar_t> >(l);
+        {
+            (void)std::numpunct<wchar_t>::id;
+        }
+        static_assert((std::is_same<std::numpunct<wchar_t>::char_type, wchar_t>::value), "");
+        static_assert((std::is_same<std::numpunct<wchar_t>::string_type, std::wstring>::value), "");
+        static_assert((std::is_base_of<std::locale::facet, std::numpunct<wchar_t> >::value), "");
+    }
+}
diff --git a/test/localization/locale.categories/facet.numpunct/nothing_to_do.pass.cpp b/test/localization/locale.categories/facet.numpunct/nothing_to_do.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/facet.numpunct/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.categories/facets.examples/nothing_to_do.pass.cpp b/test/localization/locale.categories/facets.examples/nothing_to_do.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.categories/facets.examples/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locale.syn/nothing_to_do.pass.cpp b/test/localization/locale.syn/nothing_to_do.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locale.syn/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locales/locale.convenience/classification/isalnum.pass.cpp b/test/localization/locales/locale.convenience/classification/isalnum.pass.cpp
new file mode 100644
index 0000000..70bb6ec
--- /dev/null
+++ b/test/localization/locales/locale.convenience/classification/isalnum.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> bool isalnum (charT c, const locale& loc);
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l;
+    assert(!std::isalnum(' ', l));
+    assert(!std::isalnum('<', l));
+    assert(!std::isalnum('\x8', l));
+    assert( std::isalnum('A', l));
+    assert( std::isalnum('a', l));
+    assert( std::isalnum('z', l));
+    assert( std::isalnum('3', l));
+    assert(!std::isalnum('.', l));
+    assert( std::isalnum('f', l));
+    assert( std::isalnum('9', l));
+    assert(!std::isalnum('+', l));
+}
diff --git a/test/localization/locales/locale.convenience/classification/isalpha.pass.cpp b/test/localization/locales/locale.convenience/classification/isalpha.pass.cpp
new file mode 100644
index 0000000..fa7842d
--- /dev/null
+++ b/test/localization/locales/locale.convenience/classification/isalpha.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> bool isalpha (charT c, const locale& loc);
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l;
+    assert(!std::isalpha(' ', l));
+    assert(!std::isalpha('<', l));
+    assert(!std::isalpha('\x8', l));
+    assert( std::isalpha('A', l));
+    assert( std::isalpha('a', l));
+    assert( std::isalpha('z', l));
+    assert(!std::isalpha('3', l));
+    assert(!std::isalpha('.', l));
+    assert( std::isalpha('f', l));
+    assert(!std::isalpha('9', l));
+    assert(!std::isalpha('+', l));
+}
diff --git a/test/localization/locales/locale.convenience/classification/iscntrl.pass.cpp b/test/localization/locales/locale.convenience/classification/iscntrl.pass.cpp
new file mode 100644
index 0000000..6179c07
--- /dev/null
+++ b/test/localization/locales/locale.convenience/classification/iscntrl.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> bool iscntrl (charT c, const locale& loc);
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l;
+    assert(!std::iscntrl(' ', l));
+    assert(!std::iscntrl('<', l));
+    assert( std::iscntrl('\x8', l));
+    assert(!std::iscntrl('A', l));
+    assert(!std::iscntrl('a', l));
+    assert(!std::iscntrl('z', l));
+    assert(!std::iscntrl('3', l));
+    assert(!std::iscntrl('.', l));
+    assert(!std::iscntrl('f', l));
+    assert(!std::iscntrl('9', l));
+    assert(!std::iscntrl('+', l));
+}
diff --git a/test/localization/locales/locale.convenience/classification/isdigit.pass.cpp b/test/localization/locales/locale.convenience/classification/isdigit.pass.cpp
new file mode 100644
index 0000000..05a4383
--- /dev/null
+++ b/test/localization/locales/locale.convenience/classification/isdigit.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> bool isdigit (charT c, const locale& loc);
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l;
+    assert(!std::isdigit(' ', l));
+    assert(!std::isdigit('<', l));
+    assert(!std::isdigit('\x8', l));
+    assert(!std::isdigit('A', l));
+    assert(!std::isdigit('a', l));
+    assert(!std::isdigit('z', l));
+    assert( std::isdigit('3', l));
+    assert(!std::isdigit('.', l));
+    assert(!std::isdigit('f', l));
+    assert( std::isdigit('9', l));
+    assert(!std::isdigit('+', l));
+}
diff --git a/test/localization/locales/locale.convenience/classification/isgraph.pass.cpp b/test/localization/locales/locale.convenience/classification/isgraph.pass.cpp
new file mode 100644
index 0000000..03a19c4
--- /dev/null
+++ b/test/localization/locales/locale.convenience/classification/isgraph.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> bool isgraph (charT c, const locale& loc);
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l;
+    assert(!std::isgraph(' ', l));
+    assert( std::isgraph('<', l));
+    assert(!std::isgraph('\x8', l));
+    assert( std::isgraph('A', l));
+    assert( std::isgraph('a', l));
+    assert( std::isgraph('z', l));
+    assert( std::isgraph('3', l));
+    assert( std::isgraph('.', l));
+    assert( std::isgraph('f', l));
+    assert( std::isgraph('9', l));
+    assert( std::isgraph('+', l));
+}
diff --git a/test/localization/locales/locale.convenience/classification/islower.pass.cpp b/test/localization/locales/locale.convenience/classification/islower.pass.cpp
new file mode 100644
index 0000000..7327bb5
--- /dev/null
+++ b/test/localization/locales/locale.convenience/classification/islower.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> bool islower (charT c, const locale& loc);
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l;
+    assert(!std::islower(' ', l));
+    assert(!std::islower('<', l));
+    assert(!std::islower('\x8', l));
+    assert(!std::islower('A', l));
+    assert( std::islower('a', l));
+    assert( std::islower('z', l));
+    assert(!std::islower('3', l));
+    assert(!std::islower('.', l));
+    assert( std::islower('f', l));
+    assert(!std::islower('9', l));
+    assert(!std::islower('+', l));
+}
diff --git a/test/localization/locales/locale.convenience/classification/isprint.pass.cpp b/test/localization/locales/locale.convenience/classification/isprint.pass.cpp
new file mode 100644
index 0000000..828139d
--- /dev/null
+++ b/test/localization/locales/locale.convenience/classification/isprint.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> bool isprint (charT c, const locale& loc);
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l;
+    assert( std::isprint(' ', l));
+    assert( std::isprint('<', l));
+    assert(!std::isprint('\x8', l));
+    assert( std::isprint('A', l));
+    assert( std::isprint('a', l));
+    assert( std::isprint('z', l));
+    assert( std::isprint('3', l));
+    assert( std::isprint('.', l));
+    assert( std::isprint('f', l));
+    assert( std::isprint('9', l));
+    assert( std::isprint('+', l));
+}
diff --git a/test/localization/locales/locale.convenience/classification/ispunct.pass.cpp b/test/localization/locales/locale.convenience/classification/ispunct.pass.cpp
new file mode 100644
index 0000000..426f0f2
--- /dev/null
+++ b/test/localization/locales/locale.convenience/classification/ispunct.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> bool ispunct (charT c, const locale& loc);
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l;
+    assert(!std::ispunct(' ', l));
+    assert( std::ispunct('<', l));
+    assert(!std::ispunct('\x8', l));
+    assert(!std::ispunct('A', l));
+    assert(!std::ispunct('a', l));
+    assert(!std::ispunct('z', l));
+    assert(!std::ispunct('3', l));
+    assert( std::ispunct('.', l));
+    assert(!std::ispunct('f', l));
+    assert(!std::ispunct('9', l));
+    assert( std::ispunct('+', l));
+}
diff --git a/test/localization/locales/locale.convenience/classification/isspace.pass.cpp b/test/localization/locales/locale.convenience/classification/isspace.pass.cpp
new file mode 100644
index 0000000..cb4d2ed
--- /dev/null
+++ b/test/localization/locales/locale.convenience/classification/isspace.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> bool isspace (charT c, const locale& loc);
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l;
+    assert( std::isspace(' ', l));
+    assert(!std::isspace('<', l));
+    assert(!std::isspace('\x8', l));
+    assert(!std::isspace('A', l));
+    assert(!std::isspace('a', l));
+    assert(!std::isspace('z', l));
+    assert(!std::isspace('3', l));
+    assert(!std::isspace('.', l));
+    assert(!std::isspace('f', l));
+    assert(!std::isspace('9', l));
+    assert(!std::isspace('+', l));
+}
diff --git a/test/localization/locales/locale.convenience/classification/isupper.pass.cpp b/test/localization/locales/locale.convenience/classification/isupper.pass.cpp
new file mode 100644
index 0000000..2a8dc8f
--- /dev/null
+++ b/test/localization/locales/locale.convenience/classification/isupper.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> bool isupper (charT c, const locale& loc);
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l;
+    assert(!std::isupper(' ', l));
+    assert(!std::isupper('<', l));
+    assert(!std::isupper('\x8', l));
+    assert( std::isupper('A', l));
+    assert(!std::isupper('a', l));
+    assert(!std::isupper('z', l));
+    assert(!std::isupper('3', l));
+    assert(!std::isupper('.', l));
+    assert(!std::isupper('f', l));
+    assert(!std::isupper('9', l));
+    assert(!std::isupper('+', l));
+}
diff --git a/test/localization/locales/locale.convenience/classification/isxdigit.pass.cpp b/test/localization/locales/locale.convenience/classification/isxdigit.pass.cpp
new file mode 100644
index 0000000..691c95b
--- /dev/null
+++ b/test/localization/locales/locale.convenience/classification/isxdigit.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> bool isxdigit (charT c, const locale& loc);
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l;
+    assert(!std::isxdigit(' ', l));
+    assert(!std::isxdigit('<', l));
+    assert(!std::isxdigit('\x8', l));
+    assert( std::isxdigit('A', l));
+    assert( std::isxdigit('a', l));
+    assert(!std::isxdigit('z', l));
+    assert( std::isxdigit('3', l));
+    assert(!std::isxdigit('.', l));
+    assert( std::isxdigit('f', l));
+    assert( std::isxdigit('9', l));
+    assert(!std::isxdigit('+', l));
+}
diff --git a/test/localization/locales/locale.convenience/conversions/conversions.character/tolower.pass.cpp b/test/localization/locales/locale.convenience/conversions/conversions.character/tolower.pass.cpp
new file mode 100644
index 0000000..6842081
--- /dev/null
+++ b/test/localization/locales/locale.convenience/conversions/conversions.character/tolower.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> charT tolower(charT c, const locale& loc);
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l;
+    assert(std::tolower(' ', l) == ' ');
+    assert(std::tolower('<', l) == '<');
+    assert(std::tolower('\x8', l) == '\x8');
+    assert(std::tolower('A', l) == 'a');
+    assert(std::tolower('a', l) == 'a');
+    assert(std::tolower('z', l) == 'z');
+    assert(std::tolower('3', l) == '3');
+    assert(std::tolower('.', l) == '.');
+    assert(std::tolower('f', l) == 'f');
+    assert(std::tolower('9', l) == '9');
+    assert(std::tolower('+', l) == '+');
+}
diff --git a/test/localization/locales/locale.convenience/conversions/conversions.character/toupper.pass.cpp b/test/localization/locales/locale.convenience/conversions/conversions.character/toupper.pass.cpp
new file mode 100644
index 0000000..5b341a2
--- /dev/null
+++ b/test/localization/locales/locale.convenience/conversions/conversions.character/toupper.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT> charT toupper(charT c, const locale& loc);
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale l;
+    assert(std::toupper(' ', l) == ' ');
+    assert(std::toupper('<', l) == '<');
+    assert(std::toupper('\x8', l) == '\x8');
+    assert(std::toupper('A', l) == 'A');
+    assert(std::toupper('a', l) == 'A');
+    assert(std::toupper('z', l) == 'Z');
+    assert(std::toupper('3', l) == '3');
+    assert(std::toupper('.', l) == '.');
+    assert(std::toupper('f', l) == 'F');
+    assert(std::toupper('9', l) == '9');
+    assert(std::toupper('+', l) == '+');
+}
diff --git a/test/localization/locales/locale.convenience/conversions/nothing_to_do.pass.cpp b/test/localization/locales/locale.convenience/conversions/nothing_to_do.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locales/locale.convenience/conversions/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locales/locale.convenience/nothing_to_do.pass.cpp b/test/localization/locales/locale.convenience/nothing_to_do.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locales/locale.convenience/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locales/locale.global.templates/has_facet.pass.cpp b/test/localization/locales/locale.global.templates/has_facet.pass.cpp
new file mode 100644
index 0000000..223d958
--- /dev/null
+++ b/test/localization/locales/locale.global.templates/has_facet.pass.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class Facet> bool has_facet(const locale& loc) throw();
+
+#include <locale>
+#include <cassert>
+
+struct my_facet
+    : public std::locale::facet
+{
+    static std::locale::id id;
+};
+
+std::locale::id my_facet::id;
+
+int main()
+{
+    std::locale loc;
+    assert(std::has_facet<std::ctype<char> >(loc));
+    assert(!std::has_facet<my_facet>(loc));
+    std::locale loc2(loc, new my_facet);
+    assert(std::has_facet<my_facet>(loc2));
+}
diff --git a/test/localization/locales/locale.global.templates/use_facet.pass.cpp b/test/localization/locales/locale.global.templates/use_facet.pass.cpp
new file mode 100644
index 0000000..35e4715
--- /dev/null
+++ b/test/localization/locales/locale.global.templates/use_facet.pass.cpp
@@ -0,0 +1,52 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class Facet> const Facet& use_facet(const locale& loc);
+
+#include <locale>
+#include <cassert>
+
+int facet_count = 0;
+
+struct my_facet
+    : public std::locale::facet
+{
+    static std::locale::id id;
+
+    bool im_alive;
+
+    my_facet() : im_alive(true) {++facet_count;}
+    ~my_facet() {im_alive = false; --facet_count;}
+};
+
+std::locale::id my_facet::id;
+
+int main()
+{
+    try
+    {
+        const my_facet& f = std::use_facet<my_facet>(std::locale());
+        assert(false);
+    }
+    catch (std::bad_cast&)
+    {
+    }
+    const my_facet* fp = 0;
+    {
+        std::locale loc(std::locale(), new my_facet);
+        const my_facet& f = std::use_facet<my_facet>(loc);
+        assert(f.im_alive);
+        fp = &f;
+        assert(fp->im_alive);
+        assert(facet_count == 1);
+    }
+    assert(facet_count == 0);
+}
diff --git a/test/localization/locales/locale/locale.cons/assign.pass.cpp b/test/localization/locales/locale/locale.cons/assign.pass.cpp
new file mode 100644
index 0000000..7b065a9
--- /dev/null
+++ b/test/localization/locales/locale/locale.cons/assign.pass.cpp
@@ -0,0 +1,78 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// const locale& operator=(const locale& other) throw();
+
+#include <locale>
+#include <cassert>
+#include <new>
+
+int new_called = 0;
+
+void* operator new(std::size_t s) throw(std::bad_alloc)
+{
+    ++new_called;
+    return std::malloc(s);
+}
+
+void  operator delete(void* p) throw()
+{
+    --new_called;
+    std::free(p);
+}
+
+void check(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<char> >(loc));
+    assert(std::has_facet<std::collate<wchar_t> >(loc));
+
+    assert(std::has_facet<std::ctype<char> >(loc));
+    assert(std::has_facet<std::ctype<wchar_t> >(loc));
+    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
+
+    assert((std::has_facet<std::moneypunct<char> >(loc)));
+    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_get<char> >(loc)));
+    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_put<char> >(loc)));
+    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::numpunct<char> >(loc)));
+    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_get<char> >(loc)));
+    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_put<char> >(loc)));
+    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::time_get<char> >(loc)));
+    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::time_put<char> >(loc)));
+    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::messages<char> >(loc)));
+    assert((std::has_facet<std::messages<wchar_t> >(loc)));
+}
+
+int main()
+{
+    {
+        std::locale loc("ru_RU");
+        std::locale loc2;
+        loc2 = loc;
+        assert(loc == loc2);
+        check(loc);
+        check(loc2);
+    }
+    assert(new_called == 0);
+}
diff --git a/test/localization/locales/locale/locale.cons/char_pointer.pass.cpp b/test/localization/locales/locale/locale.cons/char_pointer.pass.cpp
new file mode 100644
index 0000000..b3b581a
--- /dev/null
+++ b/test/localization/locales/locale/locale.cons/char_pointer.pass.cpp
@@ -0,0 +1,98 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// explicit locale(const char* std_name);
+
+#include <locale>
+#include <new>
+#include <cassert>
+
+int new_called = 0;
+
+void* operator new(std::size_t s) throw(std::bad_alloc)
+{
+    ++new_called;
+    return std::malloc(s);
+}
+
+void  operator delete(void* p) throw()
+{
+    --new_called;
+    std::free(p);
+}
+
+void check(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<char> >(loc));
+    assert(std::has_facet<std::collate<wchar_t> >(loc));
+
+    assert(std::has_facet<std::ctype<char> >(loc));
+    assert(std::has_facet<std::ctype<wchar_t> >(loc));
+    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
+
+    assert((std::has_facet<std::moneypunct<char> >(loc)));
+    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_get<char> >(loc)));
+    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_put<char> >(loc)));
+    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::numpunct<char> >(loc)));
+    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_get<char> >(loc)));
+    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_put<char> >(loc)));
+    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::time_get<char> >(loc)));
+    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::time_put<char> >(loc)));
+    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::messages<char> >(loc)));
+    assert((std::has_facet<std::messages<wchar_t> >(loc)));
+}
+
+int main()
+{
+    {
+        std::locale loc("ru_RU");
+        check(loc);
+        std::locale loc2("ru_RU");
+        check(loc2);
+        assert(loc == loc2);
+        std::locale loc3("zh_CN");
+        check(loc3);
+        assert(!(loc == loc3));
+        assert(loc != loc3);
+        try
+        {
+            std::locale((const char*)0);
+            assert(false);
+        }
+        catch (std::runtime_error&)
+        {
+        }
+        try
+        {
+            std::locale("spazbot");
+            assert(false);
+        }
+        catch (std::runtime_error&)
+        {
+        }
+        std::locale ok("");
+    }
+    assert(new_called == 0);
+}
diff --git a/test/localization/locales/locale/locale.cons/copy.pass.cpp b/test/localization/locales/locale/locale.cons/copy.pass.cpp
new file mode 100644
index 0000000..3b9ee47
--- /dev/null
+++ b/test/localization/locales/locale/locale.cons/copy.pass.cpp
@@ -0,0 +1,77 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// locale(const locale& other) throw();
+
+#include <locale>
+#include <cassert>
+#include <new>
+
+int new_called = 0;
+
+void* operator new(std::size_t s) throw(std::bad_alloc)
+{
+    ++new_called;
+    return std::malloc(s);
+}
+
+void  operator delete(void* p) throw()
+{
+    --new_called;
+    std::free(p);
+}
+
+void check(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<char> >(loc));
+    assert(std::has_facet<std::collate<wchar_t> >(loc));
+
+    assert(std::has_facet<std::ctype<char> >(loc));
+    assert(std::has_facet<std::ctype<wchar_t> >(loc));
+    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
+
+    assert((std::has_facet<std::moneypunct<char> >(loc)));
+    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_get<char> >(loc)));
+    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_put<char> >(loc)));
+    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::numpunct<char> >(loc)));
+    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_get<char> >(loc)));
+    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_put<char> >(loc)));
+    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::time_get<char> >(loc)));
+    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::time_put<char> >(loc)));
+    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::messages<char> >(loc)));
+    assert((std::has_facet<std::messages<wchar_t> >(loc)));
+}
+
+int main()
+{
+    {
+        std::locale loc("fr_FR");
+        std::locale loc2 = loc;
+        assert(loc == loc2);
+        check(loc);
+        check(loc2);
+    }
+    assert(new_called == 0);
+}
diff --git a/test/localization/locales/locale/locale.cons/default.pass.cpp b/test/localization/locales/locale/locale.cons/default.pass.cpp
new file mode 100644
index 0000000..2cc2cc5
--- /dev/null
+++ b/test/localization/locales/locale/locale.cons/default.pass.cpp
@@ -0,0 +1,87 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// locale() throw();
+
+#include <locale>
+#include <new>
+#include <cassert>
+
+int new_called = 0;
+
+void* operator new(std::size_t s) throw(std::bad_alloc)
+{
+    ++new_called;
+    return std::malloc(s);
+}
+
+void  operator delete(void* p) throw()
+{
+    --new_called;
+    std::free(p);
+}
+
+void check(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<char> >(loc));
+    assert(std::has_facet<std::collate<wchar_t> >(loc));
+
+    assert(std::has_facet<std::ctype<char> >(loc));
+    assert(std::has_facet<std::ctype<wchar_t> >(loc));
+    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
+
+    assert((std::has_facet<std::moneypunct<char> >(loc)));
+    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_get<char> >(loc)));
+    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_put<char> >(loc)));
+    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::numpunct<char> >(loc)));
+    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_get<char> >(loc)));
+    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_put<char> >(loc)));
+    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::time_get<char> >(loc)));
+    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::time_put<char> >(loc)));
+    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::messages<char> >(loc)));
+    assert((std::has_facet<std::messages<wchar_t> >(loc)));
+}
+
+int main()
+{
+    int ok;
+    {
+        std::locale loc;
+        assert(new_called == 0);
+        assert(loc.name() == "C");
+        assert(new_called == 0);
+        check(loc);
+        assert(new_called == 0);
+        assert(std::locale::global(std::locale("en_US")) == loc);
+        ok = new_called;
+        std::locale loc2;
+        assert(new_called == ok);
+        check(loc2);
+        assert(new_called == ok);
+        assert(loc2 == std::locale("en_US"));
+        assert(new_called == ok);
+    }
+    assert(new_called == ok);
+}
diff --git a/test/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp b/test/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp
new file mode 100644
index 0000000..c8fb0e1
--- /dev/null
+++ b/test/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp
@@ -0,0 +1,76 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// locale(const locale& other, const char* std_name, category);
+
+#include <locale>
+#include <new>
+#include <cassert>
+
+int new_called = 0;
+
+void* operator new(std::size_t s) throw(std::bad_alloc)
+{
+    ++new_called;
+    return std::malloc(s);
+}
+
+void  operator delete(void* p) throw()
+{
+    --new_called;
+    std::free(p);
+}
+
+void check(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<char> >(loc));
+    assert(std::has_facet<std::collate<wchar_t> >(loc));
+
+    assert(std::has_facet<std::ctype<char> >(loc));
+    assert(std::has_facet<std::ctype<wchar_t> >(loc));
+    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
+
+    assert((std::has_facet<std::moneypunct<char> >(loc)));
+    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_get<char> >(loc)));
+    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_put<char> >(loc)));
+    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::numpunct<char> >(loc)));
+    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_get<char> >(loc)));
+    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_put<char> >(loc)));
+    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::time_get<char> >(loc)));
+    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::time_put<char> >(loc)));
+    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::messages<char> >(loc)));
+    assert((std::has_facet<std::messages<wchar_t> >(loc)));
+}
+
+int main()
+{
+    {
+        std::locale loc("ru_RU");
+        check(loc);
+        std::locale loc2(loc, "en_US", std::locale::monetary);
+        check(loc2);
+    }
+    assert(new_called == 0);
+}
diff --git a/test/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp b/test/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp
new file mode 100644
index 0000000..4bf57aa
--- /dev/null
+++ b/test/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp
@@ -0,0 +1,101 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class Facet> locale(const locale& other, Facet* f);
+
+#include <locale>
+#include <new>
+#include <cassert>
+
+int new_called = 0;
+
+void* operator new(std::size_t s) throw(std::bad_alloc)
+{
+    ++new_called;
+    return std::malloc(s);
+}
+
+void  operator delete(void* p) throw()
+{
+    --new_called;
+    std::free(p);
+}
+
+void check(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<char> >(loc));
+    assert(std::has_facet<std::collate<wchar_t> >(loc));
+
+    assert(std::has_facet<std::ctype<char> >(loc));
+    assert(std::has_facet<std::ctype<wchar_t> >(loc));
+    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
+
+    assert((std::has_facet<std::moneypunct<char> >(loc)));
+    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_get<char> >(loc)));
+    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_put<char> >(loc)));
+    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::numpunct<char> >(loc)));
+    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_get<char> >(loc)));
+    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_put<char> >(loc)));
+    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::time_get<char> >(loc)));
+    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::time_put<char> >(loc)));
+    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::messages<char> >(loc)));
+    assert((std::has_facet<std::messages<wchar_t> >(loc)));
+}
+
+struct my_facet
+    : public std::locale::facet
+{
+    int test() const {return 5;}
+
+    static std::locale::id id;
+};
+
+std::locale::id my_facet::id;
+
+int main()
+{
+{
+    {
+        std::locale loc("ru_RU");
+        check(loc);
+        std::locale loc2(loc, new my_facet);
+        check(loc2);
+        assert((std::has_facet<my_facet>(loc2)));
+        const my_facet& f = std::use_facet<my_facet>(loc2);
+        assert(f.test() == 5);
+    }
+    assert(new_called == 0);
+}
+{
+    {
+        std::locale loc;
+        check(loc);
+        std::locale loc2(loc, (std::ctype<char>*)0);
+        check(loc2);
+        assert(loc == loc2);
+    }
+    assert(new_called == 0);
+}
+}
diff --git a/test/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp b/test/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp
new file mode 100644
index 0000000..fe0604b
--- /dev/null
+++ b/test/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp
@@ -0,0 +1,76 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// locale(const locale& other, const locale& one, category cats);
+
+#include <locale>
+#include <new>
+#include <cassert>
+
+int new_called = 0;
+
+void* operator new(std::size_t s) throw(std::bad_alloc)
+{
+    ++new_called;
+    return std::malloc(s);
+}
+
+void  operator delete(void* p) throw()
+{
+    --new_called;
+    std::free(p);
+}
+
+void check(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<char> >(loc));
+    assert(std::has_facet<std::collate<wchar_t> >(loc));
+
+    assert(std::has_facet<std::ctype<char> >(loc));
+    assert(std::has_facet<std::ctype<wchar_t> >(loc));
+    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
+
+    assert((std::has_facet<std::moneypunct<char> >(loc)));
+    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_get<char> >(loc)));
+    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_put<char> >(loc)));
+    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::numpunct<char> >(loc)));
+    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_get<char> >(loc)));
+    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_put<char> >(loc)));
+    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::time_get<char> >(loc)));
+    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::time_put<char> >(loc)));
+    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::messages<char> >(loc)));
+    assert((std::has_facet<std::messages<wchar_t> >(loc)));
+}
+
+int main()
+{
+    {
+        std::locale loc("ru_RU");
+        check(loc);
+        std::locale loc2(loc, std::locale("en_US"), std::locale::monetary);
+        check(loc2);
+    }
+    assert(new_called == 0);
+}
diff --git a/test/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp b/test/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp
new file mode 100644
index 0000000..b7c2d43
--- /dev/null
+++ b/test/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp
@@ -0,0 +1,76 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// locale(const locale& other, const string& std_name, category cat);
+
+#include <locale>
+#include <new>
+#include <cassert>
+
+int new_called = 0;
+
+void* operator new(std::size_t s) throw(std::bad_alloc)
+{
+    ++new_called;
+    return std::malloc(s);
+}
+
+void  operator delete(void* p) throw()
+{
+    --new_called;
+    std::free(p);
+}
+
+void check(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<char> >(loc));
+    assert(std::has_facet<std::collate<wchar_t> >(loc));
+
+    assert(std::has_facet<std::ctype<char> >(loc));
+    assert(std::has_facet<std::ctype<wchar_t> >(loc));
+    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
+
+    assert((std::has_facet<std::moneypunct<char> >(loc)));
+    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_get<char> >(loc)));
+    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_put<char> >(loc)));
+    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::numpunct<char> >(loc)));
+    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_get<char> >(loc)));
+    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_put<char> >(loc)));
+    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::time_get<char> >(loc)));
+    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::time_put<char> >(loc)));
+    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::messages<char> >(loc)));
+    assert((std::has_facet<std::messages<wchar_t> >(loc)));
+}
+
+int main()
+{
+    {
+        std::locale loc("ru_RU");
+        check(loc);
+        std::locale loc2(loc, std::string("en_US"), std::locale::monetary);
+        check(loc2);
+    }
+    assert(new_called == 0);
+}
diff --git a/test/localization/locales/locale/locale.cons/string.pass.cpp b/test/localization/locales/locale/locale.cons/string.pass.cpp
new file mode 100644
index 0000000..949ccc3
--- /dev/null
+++ b/test/localization/locales/locale/locale.cons/string.pass.cpp
@@ -0,0 +1,81 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// explicit locale(const string& std_name);
+
+#include <locale>
+#include <new>
+#include <cassert>
+
+int new_called = 0;
+
+void* operator new(std::size_t s) throw(std::bad_alloc)
+{
+    ++new_called;
+    return std::malloc(s);
+}
+
+void  operator delete(void* p) throw()
+{
+    --new_called;
+    std::free(p);
+}
+
+void check(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<char> >(loc));
+    assert(std::has_facet<std::collate<wchar_t> >(loc));
+
+    assert(std::has_facet<std::ctype<char> >(loc));
+    assert(std::has_facet<std::ctype<wchar_t> >(loc));
+    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
+
+    assert((std::has_facet<std::moneypunct<char> >(loc)));
+    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_get<char> >(loc)));
+    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_put<char> >(loc)));
+    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::numpunct<char> >(loc)));
+    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_get<char> >(loc)));
+    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_put<char> >(loc)));
+    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::time_get<char> >(loc)));
+    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::time_put<char> >(loc)));
+    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::messages<char> >(loc)));
+    assert((std::has_facet<std::messages<wchar_t> >(loc)));
+}
+
+int main()
+{
+    {
+        std::locale loc(std::string("ru_RU"));
+        check(loc);
+        std::locale loc2(std::string("ru_RU"));
+        check(loc2);
+        assert(loc == loc2);
+        std::locale loc3(std::string("zh_CN"));
+        check(loc3);
+        assert(!(loc == loc3));
+        assert(loc != loc3);
+    }
+    assert(new_called == 0);
+}
diff --git a/test/localization/locales/locale/locale.members/combine.pass.cpp b/test/localization/locales/locale/locale.members/combine.pass.cpp
new file mode 100644
index 0000000..223ff26
--- /dev/null
+++ b/test/localization/locales/locale/locale.members/combine.pass.cpp
@@ -0,0 +1,107 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class Facet> locale combine(const locale& other) const;
+
+#include <locale>
+#include <new>
+#include <cassert>
+
+int new_called = 0;
+
+void* operator new(std::size_t s) throw(std::bad_alloc)
+{
+    ++new_called;
+    return std::malloc(s);
+}
+
+void  operator delete(void* p) throw()
+{
+    --new_called;
+    std::free(p);
+}
+
+void check(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<char> >(loc));
+    assert(std::has_facet<std::collate<wchar_t> >(loc));
+
+    assert(std::has_facet<std::ctype<char> >(loc));
+    assert(std::has_facet<std::ctype<wchar_t> >(loc));
+    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
+
+    assert((std::has_facet<std::moneypunct<char> >(loc)));
+    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_get<char> >(loc)));
+    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_put<char> >(loc)));
+    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::numpunct<char> >(loc)));
+    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_get<char> >(loc)));
+    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_put<char> >(loc)));
+    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::time_get<char> >(loc)));
+    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::time_put<char> >(loc)));
+    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::messages<char> >(loc)));
+    assert((std::has_facet<std::messages<wchar_t> >(loc)));
+}
+
+struct my_facet
+    : public std::locale::facet
+{
+    int test() const {return 5;}
+
+    static std::locale::id id;
+};
+
+std::locale::id my_facet::id;
+
+int main()
+{
+{
+    {
+        std::locale loc;
+        std::locale loc2(loc, new my_facet);
+        std::locale loc3 = loc.combine<my_facet>(loc2);
+        check(loc3);
+        assert(loc3.name() == "*");
+        assert((std::has_facet<my_facet>(loc3)));
+        const my_facet& f = std::use_facet<my_facet>(loc3);
+        assert(f.test() == 5);
+    }
+    assert(new_called == 0);
+}
+{
+    {
+        std::locale loc;
+        std::locale loc2;
+        try
+        {
+            std::locale loc3 = loc.combine<my_facet>(loc2);
+            assert(false);
+        }
+        catch (std::runtime_error&)
+        {
+        }
+    }
+    assert(new_called == 0);
+}
+}
diff --git a/test/localization/locales/locale/locale.members/name.pass.cpp b/test/localization/locales/locale/locale.members/name.pass.cpp
new file mode 100644
index 0000000..6bf3788
--- /dev/null
+++ b/test/localization/locales/locale/locale.members/name.pass.cpp
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// basic_string<char> name() const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    {
+        std::locale loc;
+        assert(loc.name() == "C");
+    }
+    {
+        std::locale loc("en_US");
+        assert(loc.name() == "en_US");
+    }
+}
diff --git a/test/localization/locales/locale/locale.operators/compare.pass.cpp b/test/localization/locales/locale/locale.operators/compare.pass.cpp
new file mode 100644
index 0000000..74c627f
--- /dev/null
+++ b/test/localization/locales/locale/locale.operators/compare.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class charT, class Traits, class Allocator> 
+//   bool operator()(const basic_string<charT,Traits,Allocator>& s1, 
+//                   const basic_string<charT,Traits,Allocator>& s2) const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    {
+        std::locale l;
+        {
+            std::string s2("aaaaaaA");
+            std::string s3("BaaaaaA");
+            assert(l(s3, s2));
+        }
+        {
+            std::wstring s2(L"aaaaaaA");
+            std::wstring s3(L"BaaaaaA");
+            assert(l(s3, s2));
+        }
+    }
+}
diff --git a/test/localization/locales/locale/locale.operators/eq.pass.cpp b/test/localization/locales/locale/locale.operators/eq.pass.cpp
new file mode 100644
index 0000000..5a04804
--- /dev/null
+++ b/test/localization/locales/locale/locale.operators/eq.pass.cpp
@@ -0,0 +1,82 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// basic_string<char> name() const;
+
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::locale cloc;
+    std::locale copy(cloc);
+    std::locale n1("en_US");
+    std::locale n2("en_US");
+    std::locale noname1 = n1.combine<std::ctype<char> >(cloc);
+    std::locale nonamec = noname1;
+    std::locale noname2 = n1.combine<std::ctype<char> >(cloc);
+
+    assert(cloc == cloc);
+    assert(cloc == copy);
+    assert(cloc != n1);
+    assert(cloc != n2);
+    assert(cloc != noname1);
+    assert(cloc != nonamec);
+    assert(cloc != noname2);
+
+    assert(copy == cloc);
+    assert(copy == copy);
+    assert(copy != n1);
+    assert(copy != n2);
+    assert(copy != noname1);
+    assert(copy != nonamec);
+    assert(copy != noname2);
+
+    assert(n1 != cloc);
+    assert(n1 != copy);
+    assert(n1 == n1);
+    assert(n1 == n2);
+    assert(n1 != noname1);
+    assert(n1 != nonamec);
+    assert(n1 != noname2);
+
+    assert(n2 != cloc);
+    assert(n2 != copy);
+    assert(n2 == n1);
+    assert(n2 == n2);
+    assert(n2 != noname1);
+    assert(n2 != nonamec);
+    assert(n2 != noname2);
+
+    assert(noname1 != cloc);
+    assert(noname1 != copy);
+    assert(noname1 != n1);
+    assert(noname1 != n2);
+    assert(noname1 == noname1);
+    assert(noname1 == nonamec);
+    assert(noname1 != noname2);
+
+    assert(nonamec != cloc);
+    assert(nonamec != copy);
+    assert(nonamec != n1);
+    assert(nonamec != n2);
+    assert(nonamec == noname1);
+    assert(nonamec == nonamec);
+    assert(nonamec != noname2);
+
+    assert(noname2 != cloc);
+    assert(noname2 != copy);
+    assert(noname2 != n1);
+    assert(noname2 != n2);
+    assert(noname2 != noname1);
+    assert(noname2 != nonamec);
+    assert(noname2 == noname2);
+}
diff --git a/test/localization/locales/locale/locale.statics/classic.pass.cpp b/test/localization/locales/locale/locale.statics/classic.pass.cpp
new file mode 100644
index 0000000..2738bf8
--- /dev/null
+++ b/test/localization/locales/locale/locale.statics/classic.pass.cpp
@@ -0,0 +1,59 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// static const locale& classic();
+
+#include <locale>
+#include <cassert>
+
+void check(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<char> >(loc));
+    assert(std::has_facet<std::collate<wchar_t> >(loc));
+
+    assert(std::has_facet<std::ctype<char> >(loc));
+    assert(std::has_facet<std::ctype<wchar_t> >(loc));
+    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
+
+    assert((std::has_facet<std::moneypunct<char> >(loc)));
+    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_get<char> >(loc)));
+    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_put<char> >(loc)));
+    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::numpunct<char> >(loc)));
+    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_get<char> >(loc)));
+    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_put<char> >(loc)));
+    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::time_get<char> >(loc)));
+    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::time_put<char> >(loc)));
+    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::messages<char> >(loc)));
+    assert((std::has_facet<std::messages<wchar_t> >(loc)));
+}
+
+int main()
+{
+    std::locale loc = std::locale::classic();
+    assert(loc.name() == "C");
+    assert(loc == std::locale("C"));
+    check(loc);
+    check(std::locale("C"));
+}
diff --git a/test/localization/locales/locale/locale.statics/global.pass.cpp b/test/localization/locales/locale/locale.statics/global.pass.cpp
new file mode 100644
index 0000000..42735e9
--- /dev/null
+++ b/test/localization/locales/locale/locale.statics/global.pass.cpp
@@ -0,0 +1,61 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// static const locale& classic();
+
+#include <locale>
+#include <cassert>
+
+void check(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<char> >(loc));
+    assert(std::has_facet<std::collate<wchar_t> >(loc));
+
+    assert(std::has_facet<std::ctype<char> >(loc));
+    assert(std::has_facet<std::ctype<wchar_t> >(loc));
+    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
+    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
+
+    assert((std::has_facet<std::moneypunct<char> >(loc)));
+    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_get<char> >(loc)));
+    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::money_put<char> >(loc)));
+    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::numpunct<char> >(loc)));
+    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_get<char> >(loc)));
+    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::num_put<char> >(loc)));
+    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::time_get<char> >(loc)));
+    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
+    assert((std::has_facet<std::time_put<char> >(loc)));
+    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
+
+    assert((std::has_facet<std::messages<char> >(loc)));
+    assert((std::has_facet<std::messages<wchar_t> >(loc)));
+}
+
+int main()
+{
+    std::locale loc;
+    assert(loc.name() == "C");
+    check(loc);
+    assert(std::locale::global(std::locale("en_US")) == loc);
+    std::locale loc2;
+    check(loc2);
+    assert(loc2 == std::locale("en_US"));
+}
diff --git a/test/localization/locales/locale/locale.types/locale.category/category.pass.cpp b/test/localization/locales/locale/locale.types/locale.category/category.pass.cpp
new file mode 100644
index 0000000..6a434ec
--- /dev/null
+++ b/test/localization/locales/locale/locale.types/locale.category/category.pass.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// typedef int category;
+
+#include <locale>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    static_assert((std::is_same<std::locale::category, int>::value), "");
+    assert(std::locale::none == 0);
+    assert(std::locale::collate);
+    assert(std::locale::ctype);
+    assert(std::locale::monetary);
+    assert(std::locale::numeric);
+    assert(std::locale::time);
+    assert(std::locale::messages);
+    assert((std::locale::collate
+          & std::locale::ctype
+          & std::locale::monetary
+          & std::locale::numeric
+          & std::locale::time
+          & std::locale::messages) == 0);
+    assert((std::locale::collate
+          | std::locale::ctype
+          | std::locale::monetary
+          | std::locale::numeric
+          | std::locale::time
+          | std::locale::messages)
+         == std::locale::all);
+}
diff --git a/test/localization/locales/locale/locale.types/locale.facet/facet.pass.cpp b/test/localization/locales/locale/locale.types/locale.facet/facet.pass.cpp
new file mode 100644
index 0000000..355674a
--- /dev/null
+++ b/test/localization/locales/locale/locale.types/locale.facet/facet.pass.cpp
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class locale::facet
+// { 
+// protected: 
+//     explicit facet(size_t refs = 0); 
+//     virtual ~facet(); 
+//     facet(const facet&) = delete; 
+//     void operator=(const facet&) = delete; 
+// };
+
+// This test isn't portable
+
+#include <locale>
+#include <cassert>
+
+struct my_facet
+    : public std::locale::facet
+{
+    static int count;
+    my_facet(unsigned refs = 0)
+        : std::locale::facet(refs)
+        {++count;}
+
+    ~my_facet() {--count;}
+};
+
+int my_facet::count = 0;
+
+int main()
+{
+    my_facet* f = new my_facet;
+    f->__add_shared();
+    assert(my_facet::count == 1);
+    f->__release_shared();
+    assert(my_facet::count == 0);
+    f = new my_facet(1);
+    f->__add_shared();
+    assert(my_facet::count == 1);
+    f->__release_shared();
+    assert(my_facet::count == 1);
+    f->__release_shared();
+    assert(my_facet::count == 0);
+}
diff --git a/test/localization/locales/locale/locale.types/locale.id/id.pass.cpp b/test/localization/locales/locale/locale.types/locale.id/id.pass.cpp
new file mode 100644
index 0000000..874766a
--- /dev/null
+++ b/test/localization/locales/locale/locale.types/locale.id/id.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class locale::id
+// {
+// public: 
+//     id();
+//     void operator=(const id&) = delete;
+//     id(const id&) = delete;
+// };
+
+// This test isn't portable
+
+#include <locale>
+#include <cassert>
+
+std::locale::id id0;
+std::locale::id id2;
+std::locale::id id1;
+
+int main()
+{
+    long id = id0.__get();
+    assert(id0.__get() == id+0);
+    assert(id0.__get() == id+0);
+    assert(id0.__get() == id+0);
+    assert(id1.__get() == id+1);
+    assert(id1.__get() == id+1);
+    assert(id1.__get() == id+1);
+    assert(id2.__get() == id+2);
+    assert(id2.__get() == id+2);
+    assert(id2.__get() == id+2);
+    assert(id0.__get() == id+0);
+    assert(id0.__get() == id+0);
+    assert(id0.__get() == id+0);
+    assert(id1.__get() == id+1);
+    assert(id1.__get() == id+1);
+    assert(id1.__get() == id+1);
+    assert(id2.__get() == id+2);
+    assert(id2.__get() == id+2);
+    assert(id2.__get() == id+2);
+}
diff --git a/test/localization/locales/locale/locale.types/nothing_to_do.pass.cpp b/test/localization/locales/locale/locale.types/nothing_to_do.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locales/locale/locale.types/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locales/locale/nothing_to_do.pass.cpp b/test/localization/locales/locale/nothing_to_do.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locales/locale/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/locales/nothing_to_do.pass.cpp b/test/localization/locales/nothing_to_do.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/locales/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/localization.general/nothing_to_do.pass.cpp b/test/localization/localization.general/nothing_to_do.pass.cpp
new file mode 100644
index 0000000..fa4d462
--- /dev/null
+++ b/test/localization/localization.general/nothing_to_do.pass.cpp
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
diff --git a/test/localization/version.pass.cpp b/test/localization/version.pass.cpp
new file mode 100644
index 0000000..2618306
--- /dev/null
+++ b/test/localization/version.pass.cpp
@@ -0,0 +1,20 @@
+//===----------------------------------------------------------------------===//
+//
+// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+#include <locale>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+}