]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc/testsuite/
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 Mar 2007 21:22:59 +0000 (21:22 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 Mar 2007 21:22:59 +0000 (21:22 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122959 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/wchar_t-1.c
gcc/testsuite/gcc.dg/wint_t-1.c
gcc/testsuite/lib/target-supports.exp

index 4fb39f79e6672748899eb4f66fd867a3d8813eb8..e11851c9320debea49890aae6f5f062c4f426073 100644 (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
index 6d95c69c304d839725f4e64864ab8e180e7a0f39..8e22ece3c6701284c2d87d27eb55e5cba26d3e2b 100644 (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
index 3f88dcbeab06d751e2ca035739943f9d5e7bf884..0574fb9a48fd9956c72588659b87a54e465516cf 100644 (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
index 834b2d2d8fdb789f61253b5b3a028dca1271dc69..113b8da00cdf07281dcd6cc61ad0a9ecae5ef66c 100644 (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>
+    }]
+}