pthread-init-1.c, [...]: New.
* gcc.dg/pthread-init-1.c, pthread-init-2.c, pthread-init-common.h: New. From-SVN: r117314
This commit is contained in:
parent
a77d42cf21
commit
57270ac1c8
4 changed files with 51 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2006-09-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
* gcc.dg/pthread-init-1.c, pthread-init-2.c,
|
||||
pthread-init-common.h: New.
|
||||
|
||||
2006-09-29 Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
* gfortran.dg/nearest_1.f90: Add -ffloat-store to defeat extra
|
||||
|
|
11
gcc/testsuite/gcc.dg/pthread-init-1.c
Normal file
11
gcc/testsuite/gcc.dg/pthread-init-1.c
Normal file
|
@ -0,0 +1,11 @@
|
|||
/* Ensure we get clean warning results when using the pthread
|
||||
* initialization macros.
|
||||
*
|
||||
* Origin: Kaveh Ghazi (ghazi@caip.rutgers.edu) 9/27/2006.
|
||||
*/
|
||||
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-Wextra -Wall" } */
|
||||
|
||||
#include "pthread-init-common.h"
|
||||
|
11
gcc/testsuite/gcc.dg/pthread-init-2.c
Normal file
11
gcc/testsuite/gcc.dg/pthread-init-2.c
Normal file
|
@ -0,0 +1,11 @@
|
|||
/* Various Solaris versions have been known to have problems with the
|
||||
* pthread initialization macros when __STDC__ is defined.
|
||||
*
|
||||
* Origin: Kaveh Ghazi (ghazi@caip.rutgers.edu) 9/27/2006.
|
||||
*/
|
||||
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-Wextra -Wall -ansi" } */
|
||||
|
||||
#include "pthread-init-common.h"
|
||||
|
24
gcc/testsuite/gcc.dg/pthread-init-common.h
Normal file
24
gcc/testsuite/gcc.dg/pthread-init-common.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Common code for the pthread-init-*.c tests.
|
||||
*
|
||||
* Origin: Kaveh Ghazi (ghazi@caip.rutgers.edu) 9/27/2006.
|
||||
*/
|
||||
|
||||
#include <pthread.h>
|
||||
#define UNUSED __attribute__ ((__unused__))
|
||||
|
||||
void foo(void)
|
||||
{
|
||||
#ifdef PTHREAD_MUTEX_INITIALIZER
|
||||
pthread_mutex_t pmutex UNUSED = PTHREAD_MUTEX_INITIALIZER;
|
||||
#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_ONCE_INIT
|
||||
pthread_once_t ponce UNUSED = PTHREAD_ONCE_INIT;
|
||||
#endif
|
||||
}
|
Loading…
Add table
Reference in a new issue