summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests/lib/libpthread/t_rwlock.c
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2016-12-03 02:47:16 +0000
committerngie <ngie@FreeBSD.org>2016-12-03 02:47:16 +0000
commit29db3b90328498474388e9cfb2c8ef6d816c05c2 (patch)
tree91ac81530a80d5ea64a24212d143cb2012f49a0a /contrib/netbsd-tests/lib/libpthread/t_rwlock.c
parent8408238ce58163c0d88dea333c155b6806aae830 (diff)
downloadFreeBSD-src-29db3b90328498474388e9cfb2c8ef6d816c05c2.zip
FreeBSD-src-29db3b90328498474388e9cfb2c8ef6d816c05c2.tar.gz
MFC r305358:
Update contrib/netbsd-tests with new content from NetBSD This updates the snapshot from 09/30/2014 to 08/11/2016 This brings in a number of new testcases from upstream, most notably: - bin/cat - lib/libc - lib/msun - lib/libthr - usr.bin/sort lib/libc/tests/stdio/open_memstream_test.c was moved to lib/libc/tests/stdio/open_memstream2_test.c to accomodate the new open_memstream test from NetBSD. Tested on: amd64 (VMware fusion VM; various bare metal platforms); i386 (VMware fusion VM); make tinderbox
Diffstat (limited to 'contrib/netbsd-tests/lib/libpthread/t_rwlock.c')
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_rwlock.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/contrib/netbsd-tests/lib/libpthread/t_rwlock.c b/contrib/netbsd-tests/lib/libpthread/t_rwlock.c
index b2a3d6f..81f8c58 100644
--- a/contrib/netbsd-tests/lib/libpthread/t_rwlock.c
+++ b/contrib/netbsd-tests/lib/libpthread/t_rwlock.c
@@ -1,4 +1,4 @@
-/* $NetBSD: t_rwlock.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $ */
+/* $NetBSD: t_rwlock.c,v 1.2 2015/06/26 11:07:20 pooka Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_rwlock.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $");
+__RCSID("$NetBSD: t_rwlock.c,v 1.2 2015/06/26 11:07:20 pooka Exp $");
#include <errno.h>
#include <pthread.h>
@@ -70,6 +70,8 @@ pthread_rwlock_t lk;
struct timespec to;
+static pthread_rwlock_t static_rwlock = PTHREAD_RWLOCK_INITIALIZER;
+
/* ARGSUSED */
static void *
do_nothing(void *dummy)
@@ -117,9 +119,23 @@ ATF_TC_BODY(rwlock1, tc)
"%s", strerror(error));
}
+ATF_TC(rwlock_static);
+ATF_TC_HEAD(rwlock_static, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "rwlock w/ static initializer");
+}
+ATF_TC_BODY(rwlock_static, tc)
+{
+
+ PTHREAD_REQUIRE(pthread_rwlock_rdlock(&static_rwlock));
+ PTHREAD_REQUIRE(pthread_rwlock_unlock(&static_rwlock));
+ PTHREAD_REQUIRE(pthread_rwlock_destroy(&static_rwlock));
+}
+
ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, rwlock1);
+ ATF_TP_ADD_TC(tp, rwlock_static);
return atf_no_error();
}
OpenPOWER on IntegriCloud