This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Re: [PATCH]: add tests for pthread initialization macros


Kaveh R. Ghazi wrote:

Now that all my fixincludes patches are in, I've installed the
testcase, but only on mainline.  I'd like to see how cleanly it passes
on other platforms before considering whether to backport it.

Uros - I would welcome seeing a patch from you adding the extra glibc
macros to the testcase's common file.


My fixincludes patch, posted a couple of moments ago, fixes initializers that are exposed by your testcase. However, there are some more wrong defines in glibc, and attached testsuite patch exposes more glibc-2.3.5 initializer failures. These will be fixed as a follow-up fixincludes patch.

BTW: A #define _GNU_SOURCE is necessary to activate these new tests.

2006-09-30 Uros Bizjak <uros@kss-loka.si>

* gcc.dg/pthread-init-1.c: Define _GNU_SOURCE.
* gdd.dg/pthread-init-2.c: Likewise.
* gcc-dg/pthread-init-common.h: Add tests for
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP and
PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP mutex initializers.


Uros.

Index: gcc.dg/pthread-init-1.c
===================================================================
--- gcc.dg/pthread-init-1.c	(revision 117328)
+++ gcc.dg/pthread-init-1.c	(working copy)
@@ -7,5 +7,7 @@
 /* { dg-do compile } */
 /* { dg-options "-Wextra -Wall" } */
 
+#define _GNU_SOURCE
+
 #include "pthread-init-common.h"
 
Index: gcc.dg/pthread-init-common.h
===================================================================
--- gcc.dg/pthread-init-common.h	(revision 117328)
+++ gcc.dg/pthread-init-common.h	(working copy)
@@ -12,12 +12,25 @@
 #ifdef PTHREAD_MUTEX_INITIALIZER
   pthread_mutex_t pmutex UNUSED = PTHREAD_MUTEX_INITIALIZER;
 #endif
+#ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+  pthread_mutex_t pmutex_rc UNUSED = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+#endif
+#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+  pthread_mutex_t pmutex_ec UNUSED = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
+#endif
+#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+  pthread_mutex_t pmutex_ad UNUSED = PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP;
+#endif
 #ifdef PTHREAD_COND_INITIALIZER
   pthread_cond_t pcond UNUSED = PTHREAD_COND_INITIALIZER;
 #endif
 #ifdef PTHREAD_RWLOCK_INITIALIZER
   pthread_rwlock_t prwlock UNUSED = PTHREAD_RWLOCK_INITIALIZER;
 #endif
+#ifdef PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP
+  pthread_rwlock_t prwlock_nrc UNUSED
+    = PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP;
+#endif
 #ifdef PTHREAD_ONCE_INIT
   pthread_once_t ponce UNUSED = PTHREAD_ONCE_INIT;
 #endif
Index: gcc.dg/pthread-init-2.c
===================================================================
--- gcc.dg/pthread-init-2.c	(revision 117328)
+++ gcc.dg/pthread-init-2.c	(working copy)
@@ -7,5 +7,7 @@
 /* { dg-do compile } */
 /* { dg-options "-Wextra -Wall -ansi" } */
 
+#define _GNU_SOURCE
+
 #include "pthread-init-common.h"
 

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