Index: testsuite/22_locale/numpunct/members/char/3.cc
===================================================================
--- testsuite/22_locale/numpunct/members/char/3.cc	(revision 218492)
+++ testsuite/22_locale/numpunct/members/char/3.cc	(working copy)
@@ -21,6 +21,7 @@
 
 // 22.2.3.2 Template class numpunct_byname
 
+#include <sstream>
 #include <locale>
 #include <testsuite_hooks.h>
 
@@ -30,13 +31,52 @@
   
   bool test __attribute__((unused)) = true;
 
-  locale loc_it = locale("it_IT");
+  // Use numpunct to generate representation for an arbitrary number.
+  const int number = 1000000000;
 
-  const numpunct<char>& nump_it = use_facet<numpunct<char> >(loc_it); 
+  ostringstream ostr;
+  ostr.imbue(locale::classic());
+  
+  ostr << number;
+  string c_number = ostr.str();
 
+  locale loc_it = locale("it_IT");
+  const numpunct<char>& nump_it = use_facet<numpunct<char> >(loc_it);
   string g = nump_it.grouping();
 
-  VERIFY( g == "" );
+  size_t group_index = 0;
+  string it_number;
+  size_t it_pos = 0;
+  size_t offset = 0;
+  for (size_t pos = 0; pos != c_number.size(); ++pos)
+    {
+      int group_size =
+	group_index < g.size() ? (int)g[group_index]
+		      : (g.empty()
+			 // No grouping, just make group size big enough so that
+			 // there will be no insertion of thousands separator.
+			 ? c_number.size()
+			 : g[g.size() - 1]);
+      if (pos + offset < it_pos + group_size)
+	it_number.insert(it_number.begin(), c_number[c_number.size() - pos - 1]);
+      else
+	{
+	  // Time to add the group separator.
+	  it_number.insert(it_number.begin(), nump_it.thousands_sep());
+	  it_number.insert(it_number.begin(), c_number[c_number.size() - pos - 1]);
+	  ++offset;
+	  ++group_index;
+	  it_pos = it_number.size() - 1;
+	}
+    }
+
+  // Check that the result is identical to the one obtained with an
+  // ostringstream imbued with the it_IT locale.
+  ostr.str("");
+  ostr.imbue(loc_it);
+  ostr << number;
+
+  VERIFY( ostr.str() == it_number );
 }
 
 int main()
Index: testsuite/22_locale/time_get/get_date/wchar_t/4.cc
===================================================================
--- testsuite/22_locale/time_get/get_date/wchar_t/4.cc	(revision 218492)
+++ testsuite/22_locale/time_get/get_date/wchar_t/4.cc	(working copy)
@@ -43,7 +43,7 @@
   const ios_base::iostate good = ios_base::goodbit;
   ios_base::iostate errorstate = good;
 
-  const wchar_t wstr[] = { 0x897f, 0x5143, L'2', L'0', L'0', L'3',
+  const wchar_t wstr[] = { /* 0x897f, 0x5143,*/ L'2', L'0', L'0', L'3',
 			   0x5e74, L'1', L'2', 0x6708, L'1', L'7',
 			   0x65e5 , 0x0 };
 
Index: testsuite/22_locale/time_get/get_weekday/char/38081-1.cc
===================================================================
--- testsuite/22_locale/time_get/get_weekday/char/38081-1.cc	(revision 218492)
+++ testsuite/22_locale/time_get/get_weekday/char/38081-1.cc	(working copy)
@@ -50,7 +50,7 @@
   //             ios_base::iostate&, tm*) const
 
 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 14)
-# if __GLIBC__ > 2 || __GLIBC_MINOR__ >= 17
+# if __GLIBC__ > 2 || __GLIBC_MINOR__ >= 20
   iss.str("\xbf\xdd");
 # else
   iss.str("\xbf\xdd\x2e");
@@ -76,7 +76,7 @@
   VERIFY( errorstate == ios_base::eofbit );
 
 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 14)
-# if __GLIBC__ > 2 || __GLIBC_MINOR__ >= 17
+# if __GLIBC__ > 2 || __GLIBC_MINOR__ >= 20
   iss.str("\xbf\xdd\xd5\xd4\xd5\xdb\xec\xdd\xd8\xda");
 # else
   iss.str("\xbf\xdd\x2e\xd5\xd4\xd5\xdb\xec\xdd\xd8\xda");
Index: testsuite/22_locale/time_get/get_weekday/char/38081-2.cc
===================================================================
--- testsuite/22_locale/time_get/get_weekday/char/38081-2.cc	(revision 218492)
+++ testsuite/22_locale/time_get/get_weekday/char/38081-2.cc	(working copy)
@@ -51,7 +51,7 @@
   //             ios_base::iostate&, tm*) const
 
 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 14)
-# if __GLIBC__ > 2 || __GLIBC_MINOR__ >= 17
+# if __GLIBC__ > 2 || __GLIBC_MINOR__ >= 20
   const char* awdays[7] = { "\u0412\u0441",
 			    "\u041F\u043D",
 			    "\u0412\u0442",
