summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2006-09-29 19:33:50 +0000
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2006-09-29 19:33:50 +0000
commitccedc60ca851756f8294823bb79dadb9dcc549ec (patch)
tree869881c357d6da678753baf8cb9d238ff5e16d15
parentb960b7b7bda8f90876d908ff981bef93be473d55 (diff)
downloadppe42-gcc-ccedc60ca851756f8294823bb79dadb9dcc549ec.tar.gz
ppe42-gcc-ccedc60ca851756f8294823bb79dadb9dcc549ec.zip
* gcc.dg/pthread-init-1.c, pthread-init-2.c,
pthread-init-common.h: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117314 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pthread-init-1.c11
-rw-r--r--gcc/testsuite/gcc.dg/pthread-init-2.c11
-rw-r--r--gcc/testsuite/gcc.dg/pthread-init-common.h24
4 files changed, 51 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8867570bd27..be1c1ea6dae 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
diff --git a/gcc/testsuite/gcc.dg/pthread-init-1.c b/gcc/testsuite/gcc.dg/pthread-init-1.c
new file mode 100644
index 00000000000..9cf4fa3d35b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pthread-init-1.c
@@ -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"
+
diff --git a/gcc/testsuite/gcc.dg/pthread-init-2.c b/gcc/testsuite/gcc.dg/pthread-init-2.c
new file mode 100644
index 00000000000..5da84baa51b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pthread-init-2.c
@@ -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"
+
diff --git a/gcc/testsuite/gcc.dg/pthread-init-common.h b/gcc/testsuite/gcc.dg/pthread-init-common.h
new file mode 100644
index 00000000000..e9f96cefd39
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pthread-init-common.h
@@ -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
+}
OpenPOWER on IntegriCloud