Index: testsuites/psxtests/ChangeLog
===================================================================
--- testsuites/psxtests/ChangeLog	(revision 1c5d8f494936a4e3fe86cc084b9ae01dbeeaac49)
+++ testsuites/psxtests/ChangeLog	(revision 13a4c71cc40e3853844b6ca7b0b359ae19b599d3)
@@ -1,2 +1,10 @@
+2009-07-16	Joel Sherrill <joel.sherrill@oarcorp.com>
+
+	* Makefile.am, configure.ac: Add test for auto initialization of
+	message queues.
+	* psxautoinit02/.cvsignore, psxautoinit02/Makefile.am,
+	psxautoinit02/init.c, psxautoinit02/psxautoinit02.doc,
+	psxautoinit02/psxautoinit02.scn: New files.
+
 2009-07-07	Joel Sherrill <joel.sherrill@OARcorp.com>
 
Index: testsuites/psxtests/Makefile.am
===================================================================
--- testsuites/psxtests/Makefile.am	(revision 1c5d8f494936a4e3fe86cc084b9ae01dbeeaac49)
+++ testsuites/psxtests/Makefile.am	(revision 13a4c71cc40e3853844b6ca7b0b359ae19b599d3)
@@ -6,6 +6,6 @@
 
 SUBDIRS = psxhdrs psx01 psx02 psx03 psx04 psx05 psx06 psx07 psx08 psx09 \
-    psx10 psx11 psx12 psx13 psx14 psxautoinit01 psxbarrier01 psxcancel \
-    psxcleanup psxenosys psxfatal01 psxfatal02 psxkey01 psxitimer \
+    psx10 psx11 psx12 psx13 psx14 psxautoinit01 psxautoinit02 psxbarrier01 \
+    psxcancel psxcleanup psxenosys psxfatal01 psxfatal02 psxkey01 psxitimer \
     psxmsgq01 psxmsgq02 psxmsgq03 psxobj01 psxrwlock01 psxsem01 \
     psxsignal01 psxspin01 psxsysconf psxtime psxtimer01 psxtimer02  \
Index: testsuites/psxtests/configure.ac
===================================================================
--- testsuites/psxtests/configure.ac	(revision 1c5d8f494936a4e3fe86cc084b9ae01dbeeaac49)
+++ testsuites/psxtests/configure.ac	(revision 13a4c71cc40e3853844b6ca7b0b359ae19b599d3)
@@ -42,4 +42,5 @@
 psx14/Makefile
 psxautoinit01/Makefile
+psxautoinit02/Makefile
 psxbarrier01/Makefile
 psxcancel/Makefile
Index: testsuites/psxtests/psxautoinit02/.cvsignore
===================================================================
--- testsuites/psxtests/psxautoinit02/.cvsignore	(revision 13a4c71cc40e3853844b6ca7b0b359ae19b599d3)
+++ testsuites/psxtests/psxautoinit02/.cvsignore	(revision 13a4c71cc40e3853844b6ca7b0b359ae19b599d3)
@@ -0,0 +1,14 @@
+aclocal.m4
+autom4te*.cache
+config.cache
+config.guess
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+Makefile
+Makefile.in
+missing
+mkinstalldirs
Index: testsuites/psxtests/psxautoinit02/Makefile.am
===================================================================
--- testsuites/psxtests/psxautoinit02/Makefile.am	(revision 13a4c71cc40e3853844b6ca7b0b359ae19b599d3)
+++ testsuites/psxtests/psxautoinit02/Makefile.am	(revision 13a4c71cc40e3853844b6ca7b0b359ae19b599d3)
@@ -0,0 +1,32 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxautoinit02
+psxautoinit02_SOURCES = init.c ../include/pmacros.h
+
+scndir = $(rtems_testsdir)
+dist_rtems_tests_DATA = psxautoinit02.scn
+dist_rtems_tests_DATA += psxautoinit02.doc
+
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+psxautoinit02_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/include
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(psxautoinit02_OBJECTS) $(psxautoinit02_LDADD)
+LINK_LIBS = $(psxautoinit02_LDLIBS)
+
+psxautoinit02$(EXEEXT): $(psxautoinit02_OBJECTS) \
+    $(psxautoinit02_DEPENDENCIES)
+	@rm -f psxautoinit02$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am
Index: testsuites/psxtests/psxautoinit02/init.c
===================================================================
--- testsuites/psxtests/psxautoinit02/init.c	(revision 13a4c71cc40e3853844b6ca7b0b359ae19b599d3)
+++ testsuites/psxtests/psxautoinit02/init.c	(revision 13a4c71cc40e3853844b6ca7b0b359ae19b599d3)
@@ -0,0 +1,55 @@
+/*
+ *  COPYRIGHT (c) 1989-2009.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include "tmacros.h"
+#include <pthread.h>
+#include <errno.h>
+
+void *POSIX_Init(
+  void *argument
+)
+{
+  int            sc;
+  pthread_cond_t cond1;
+  pthread_cond_t cond2;
+
+  puts( "\n\n*** POSIX TEST -- AUTOMATIC INITIALIZAITON 02 ***" );
+
+  cond1 = PTHREAD_COND_INITIALIZER;
+  cond2 = PTHREAD_COND_INITIALIZER;
+  puts( "Init - pthread_cond_broadcast - auto initialize - OK" );
+  sc = pthread_cond_broadcast( &cond1 );
+  fatal_posix_service_status( sc, 0, "cond broadcast OK" );
+
+  puts( "Init - pthread_cond_broadcast - auto initialize - EINVAL" );
+  sc = pthread_cond_broadcast( &cond2 );
+  fatal_posix_service_status( sc, EINVAL, "cond lock EINVAL" );
+  
+  puts( "Init - pthread_cond_destroy - OK" );
+  sc = pthread_cond_destroy( &cond1 );
+  fatal_posix_service_status( sc, 0, "cond destroy OK" );
+
+  puts( "*** END OF POSIX TEST AUTOMATIC INITIALIZATION 02 ***" );
+  rtems_test_exit( 0 );
+
+  return NULL; /* just so the compiler thinks we returned something */
+}
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 1
+#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 1
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
Index: testsuites/psxtests/psxautoinit02/psxautoinit02.scn
===================================================================
--- testsuites/psxtests/psxautoinit02/psxautoinit02.scn	(revision 13a4c71cc40e3853844b6ca7b0b359ae19b599d3)
+++ testsuites/psxtests/psxautoinit02/psxautoinit02.scn	(revision 13a4c71cc40e3853844b6ca7b0b359ae19b599d3)
@@ -0,0 +1,5 @@
+*** POSIX TEST -- AUTOMATIC INITIALIZAITON 02 ***
+Init - pthread_cond_broadcast - auto initialize - OK
+Init - pthread_cond_broadcast - auto initialize - EINVAL
+Init - pthread_cond_destroy - OK
+*** END OF POSIX TEST AUTOMATIC INITIALIZATION 02 ***
