This is the mail archive of the mailing list for the newlib 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] Fix UTF-8.exp for non-multibyte targets

From: Yuriy Kolerov <>

Don't run UTF-8.exp test if newlib is not built with multibyte support.

Submitted on behalf of Yuriy Kolerov.


2016-04-29  Yuriy Kolerov <>

	testsuite/newlib.locale/UTF-8.exp: Don't run if multibyte support is

Signed-off-by: Yuriy Kolerov <>
Signed-off-by: Anton Kolesov <>
 newlib/testsuite/newlib.locale/UTF-8.exp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/newlib/testsuite/newlib.locale/UTF-8.exp b/newlib/testsuite/newlib.locale/UTF-8.exp
index e823a4f..94fcb5f 100644
--- a/newlib/testsuite/newlib.locale/UTF-8.exp
+++ b/newlib/testsuite/newlib.locale/UTF-8.exp
@@ -6,6 +6,18 @@
 load_lib checkoutput.exp
+# Don't run this test if newlib's build does not support multibyte encodings.
+set newlib_header_name "$objdir/targ-include/newlib.h"
+if [file exists $newlib_header_name] {
+    set newlib_header_fid [open $newlib_header_name r]
+    set newlib_header_text [read $newlib_header_fid]
+    close $newlib_header_fid
+    if {![regexp "#define _MB_CAPABLE" $newlib_header_text] || \
+            [regexp "#define _MB_LEN_MAX 1" $newlib_header_text]} {
+        return
+    }
 set expected_output {
 "Set C-UTF-8 locale."
 "* U-00000000"

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