Add a wchar effective target to the testsuite

Richard Sandiford richard@codesourcery.com
Fri Mar 16 10:33:00 GMT 2007


Janis Johnson <janis187@us.ibm.com> writes:
> On Thu, Mar 15, 2007 at 08:44:17AM +0000, Richard Sandiford wrote:
>> This patch adds an effective target for testing whether the runtime
>> has wide character support.  It's usually enough to check whether
>> <wchar.h> exists, but on uClibc targets, you also need to check
>> whether __UCLIBC_HAS_WCHAR__ is defined; if it isn't, the header
>> will still exist but will not be usable.
>> 
>> Tested on m68k-uclinux, i586-wrs-vxworks (which has no wchar.h)
>> and x86_64-linux-gnu.  OK to install?
>
> Yes.

Thanks.  Unfortunately, I screwed this one up too: the uclibc part
assumed that features.h exists.  glibc has it, but not all OSes do.
I've applied this patch as obvious.  I've no idea why I didn't do
it this way originally.

Richard


gcc/testsuite/
	* lib/target-supports.exp (check_missing_uclibc_feature): Don't
	assume that the target has <features.h>.

Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 122982)
+++ gcc/testsuite/lib/target-supports.exp	(working copy)
@@ -2077,15 +2077,12 @@ proc check_effective_target_uclibc {} {
 # described by __$feature__ is not present.
 
 proc check_missing_uclibc_feature {feature} {
-    if {[check_no_compiler_messages $feature object "
-	     #include <features.h>
-	     #if defined (__UCLIBC__) && !defined (__${feature}__)
-	     #error FOO
-	     #endif
-	 "]} {
-	return 0
-    }
-    return 1
+    return [check_no_compiler_messages $feature object "
+	#include <features.h>
+	#if !defined (__UCLIBC) || defined (__${feature}__)
+	#error FOO
+	#endif
+    "]
 }
 
 # Return true if this is a Newlib target.



More information about the Gcc-patches mailing list