target-supports.exp (check_effective_target_pthread_h): New.
authorJoseph Myers <joseph@codesourcery.com>
Tue, 26 Feb 2008 00:11:06 +0000 (00:11 +0000)
committerJoseph Myers <jsm28@gcc.gnu.org>
Tue, 26 Feb 2008 00:11:06 +0000 (00:11 +0000)
* lib/target-supports.exp (check_effective_target_pthread_h): New.
* gcc.dg/pthread-init-1.c, gcc.dg/pthread-init-2.c: Use
dg-require-effective-target pthread_h.

From-SVN: r132650

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pthread-init-1.c
gcc/testsuite/gcc.dg/pthread-init-2.c
gcc/testsuite/lib/target-supports.exp

index 074e43621b66da0f40503e64cc70ff1d79f1056d..db11e64a8a1b20ffe45c3bd8ff93a6e0de89a275 100644 (file)
@@ -1,3 +1,9 @@
+2008-02-25  Joseph Myers  <joseph@codesourcery.com>
+
+       * lib/target-supports.exp (check_effective_target_pthread_h): New.
+       * gcc.dg/pthread-init-1.c, gcc.dg/pthread-init-2.c: Use
+       dg-require-effective-target pthread_h.
+
 2008-02-26  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
 
        * gcc.dg/Wswitch-enum-error.c: New.
index 9cf4fa3d35b896544a83ba11e5670602836e8f96..2f78844fe1fe787e4c311b5f1b6efff443a34f49 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 /* { dg-do compile } */
+/* { dg-require-effective-target pthread_h } */
 /* { dg-options "-Wextra -Wall" } */
 
 #include "pthread-init-common.h"
index 6fc427fe2eb182d4ac667dd30f28a6b420b8eee8..2e1b93aecbfd4bff51705ddc6cf52f326c63d164 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 /* { dg-do compile } */
+/* { dg-require-effective-target pthread_h } */
 /* { dg-options "-Wextra -Wall -ansi" } */
 /* { dg-options "-Wextra -Wall -ansi -D_POSIX_C_SOURCE=199506L" { target { *-*-hpux* *-*-solaris2.5.1 } } } */
 
index ba1454eaab8d2ba3daab93943d234bd863ea328c..c43a37180c9e90d760d04512786c7e7a7e47f78b 100644 (file)
@@ -2214,6 +2214,14 @@ proc check_effective_target_wchar { } {
     }]
 }
 
+# Return 1 if the target has <pthread.h>.
+
+proc check_effective_target_pthread_h { } {
+    return [check_no_compiler_messages pthread_h assembly {
+       #include <pthread.h>
+    }]
+}
+
 # Add to FLAGS all the target-specific flags needed to access the c99 runtime.
 
 proc add_options_for_c99_runtime { flags } {