public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][libstdc++][Testsuite] isctype test fails for newlib.
@ 2015-02-02 15:49 Matthew Wahab
  2015-02-02 16:17 ` Paolo Carlini
  0 siblings, 1 reply; 18+ messages in thread
From: Matthew Wahab @ 2015-02-02 15:49 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1282 bytes --]

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: isctype_newlib.patch --]
[-- Type: text/x-patch; name=isctype_newlib.patch, Size: 1767 bytes --]

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-03-10  9:56 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-02 15:49 [PATCH][libstdc++][Testsuite] isctype test fails for newlib Matthew Wahab
2015-02-02 16:17 ` Paolo Carlini
2015-02-02 16:33   ` Jonathan Wakely
     [not found]     ` <54CFBBD5.4080205@arm.com>
2015-02-02 18:14       ` Jonathan Wakely
2015-02-03 10:17     ` Matthew Wahab
2015-02-03 10:27       ` Paolo Carlini
2015-02-03 10:40         ` Matthew Wahab
2015-02-03 11:17           ` Paolo Carlini
2015-02-07  0:12           ` Jonathan Wakely
2015-02-09 11:25             ` Matthew Wahab
2015-02-09 13:18               ` Hans-Peter Nilsson
2015-02-09 17:50                 ` Matthew Wahab
     [not found]                 ` <54D8F2F6.7030406@arm.com>
     [not found]                   ` <alpine.BSF.2.02.1502091814490.19399@arjuna.pair.com>
2015-02-10  8:51                     ` Matthew Wahab
2015-02-11 11:14                       ` Matthew Wahab
2015-02-11 15:44                         ` Jonathan Wakely
2015-02-13 13:48                           ` Matthew Wahab
2015-03-09 12:47                             ` Jonathan Wakely
2015-03-10  9:56                               ` Matthew Wahab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).