gcc/testsuite/

* lib/target-supports.exp (check_missing_uclibc_feature)
	(check_effective_target_wchar): New procedures.
	* gcc.dg/wchar_t-1.c: Require target wchar.
	* gcc.dg/wint_t-1.c: Likewise.

From-SVN: r122959
This commit is contained in:
Richard Sandiford 2007-03-15 21:22:59 +00:00 committed by Richard Sandiford
parent 34a24c113b
commit e6625c4411
4 changed files with 35 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2007-03-15 Richard Sandiford <richard@codesourcery.com>
* lib/target-supports.exp (check_missing_uclibc_feature)
(check_effective_target_wchar): New procedures.
* gcc.dg/wchar_t-1.c: Require target wchar.
* gcc.dg/wint_t-1.c: Likewise.
2007-03-15 Richard Sandiford <richard@codesourcery.com>
* lib/target-supports.exp (check_gc_sections_available): Return

View File

@ -1,4 +1,4 @@
/* { dg-do compile } */
/* { dg-do compile { target wchar } } */
/* { dg-options "-Wall" } */
/* Compile with -Wall to get a warning if built-in and system wchar_t don't

View File

@ -1,4 +1,4 @@
/* { dg-do compile } */
/* { dg-do compile { target wchar } } */
/* { dg-options "-Wall" } */
/* Compile with -Wall to get a warning if built-in and system wint_t don't

View File

@ -2073,6 +2073,21 @@ proc check_effective_target_uclibc {} {
}]
}
# Return true if this is a uclibc target and if the uclibc feature
# 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 true if this is a Newlib target.
proc check_effective_target_newlib {} {
@ -2205,3 +2220,14 @@ proc check_effective_target_vxworks_kernel { } {
#endif
}]
}
# Return 1 if the target is expected to provide wide character support.
proc check_effective_target_wchar { } {
if {[check_missing_uclibc_feature UCLIBC_HAS_WCHAR]} {
return 0
}
return [check_no_compiler_messages wchar assembly {
#include <wchar.h>
}]
}