This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][libstdc++][Testsuite] isctype test fails for newlib.


Hello,

With target arm-none-eabi, the libstdc++ tests 28_regex/traits/char/isctype.cc and 28_regex/traits/wchar/isctype.cc fail at
--
VERIFY(!t.isctype('\n', t.lookup_classname(range(blank))));
--
This is because libstdc++ puts '\n' in the 'space' character class, rather than 'blank' when building on newlib. This problem was known when suport for the blank character class was added to libstdc++ (see https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01902.html) so this failure is not unexpected.

Changes to newlib that would have allowed the problem to be fixed were made (https://sourceware.org/ml/newlib/2009/msg00342.html) but then reverted (https://sourceware.org/ml/newlib/2009/msg00438.html).

This patch modifies the test to add a special case for the behaviour with newlib.

Tested by running check-target-libstdc++-v3 - libstdc++-dg/conformance.exp, with the modified tests, for arm-none-eabi and aarch64-none-linux-gnu. No new failures and the modified tests now pass on arm-none-eabi.

Ok for trunk?
Matthew

libstdc++-v3/testsuite/
2015-02-02  Matthew Wahab  <matthew.wahab@arm.com>

	* 28_regex/traits/char/isctype.cc (test01): Add newlib special
	case for '\n'.
	* 28_regex/traits/wchar_t/isctype.cc (test01): Likewise.

diff --git a/libstdc++-v3/testsuite/28_regex/traits/char/isctype.cc b/libstdc++-v3/testsuite/28_regex/traits/char/isctype.cc
index a7b1396..df0dac8 100644
--- a/libstdc++-v3/testsuite/28_regex/traits/char/isctype.cc
+++ b/libstdc++-v3/testsuite/28_regex/traits/char/isctype.cc
@@ -53,7 +53,12 @@ test01()
   VERIFY(!t.isctype('_', t.lookup_classname(range(digit))));
   VERIFY( t.isctype(' ', t.lookup_classname(range(blank))));
   VERIFY( t.isctype('\t', t.lookup_classname(range(blank))));
+#if defined (__NEWLIB__)
+  /* newlib includes '\n' in class 'blank'.  */
+  VERIFY( t.isctype('\n', t.lookup_classname(range(blank))));
+#else
   VERIFY(!t.isctype('\n', t.lookup_classname(range(blank))));
+#endif
   VERIFY( t.isctype('t', t.lookup_classname(range(upper), true)));
   VERIFY( t.isctype('T', t.lookup_classname(range(lower), true)));
 #undef range
diff --git a/libstdc++-v3/testsuite/28_regex/traits/wchar_t/isctype.cc b/libstdc++-v3/testsuite/28_regex/traits/wchar_t/isctype.cc
index e450f6d..b6088bd 100644
--- a/libstdc++-v3/testsuite/28_regex/traits/wchar_t/isctype.cc
+++ b/libstdc++-v3/testsuite/28_regex/traits/wchar_t/isctype.cc
@@ -50,7 +50,12 @@ test01()
   VERIFY(!t.isctype(L'_', t.lookup_classname(range(digit))));
   VERIFY( t.isctype(L' ', t.lookup_classname(range(blank))));
   VERIFY( t.isctype(L'\t', t.lookup_classname(range(blank))));
+#if defined (__NEWLIB__)
+  /* newlib includes '\n' in class 'blank'.  */
+  VERIFY( t.isctype(L'\n', t.lookup_classname(range(blank))));
+#else
   VERIFY(!t.isctype(L'\n', t.lookup_classname(range(blank))));
+#endif
   VERIFY( t.isctype(L't', t.lookup_classname(range(upper), true)));
   VERIFY( t.isctype(L'T', t.lookup_classname(range(lower), true)));
 #undef range

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]