[rtems commit] psxhdrs: Added POSIX API Signature Compliance Tests for threads.h (GCI 2018)

Joel Sherrill joel at rtems.org
Sun Dec 9 15:17:19 UTC 2018


Module:    rtems
Branch:    master
Commit:    b009cfb6382bddd86440ce56c8206efb4540ec28
Changeset: http://git.rtems.org/rtems/commit/?id=b009cfb6382bddd86440ce56c8206efb4540ec28

Author:    Himanshu40 <himanshuwindows8.1 at gmail.com>
Date:      Sun Dec  9 18:08:13 2018 +0530

psxhdrs: Added POSIX API Signature Compliance Tests for threads.h (GCI 2018)

---

 testsuites/psxtests/Makefile.am                    | 25 +++++++++++
 .../psxtests/psxhdrs/c11/threads/call_once.c       | 43 +++++++++++++++++++
 .../psxtests/psxhdrs/c11/threads/cnd_broadcast.c   | 39 +++++++++++++++++
 .../psxtests/psxhdrs/c11/threads/cnd_destroy.c     | 39 +++++++++++++++++
 testsuites/psxtests/psxhdrs/c11/threads/cnd_init.c | 38 ++++++++++++++++
 .../psxtests/psxhdrs/c11/threads/cnd_signal.c      | 39 +++++++++++++++++
 .../psxtests/psxhdrs/c11/threads/cnd_timedwait.c   | 44 +++++++++++++++++++
 testsuites/psxtests/psxhdrs/c11/threads/cnd_wait.c | 41 ++++++++++++++++++
 .../psxtests/psxhdrs/c11/threads/mtx_destroy.c     | 39 +++++++++++++++++
 testsuites/psxtests/psxhdrs/c11/threads/mtx_init.c | 38 ++++++++++++++++
 testsuites/psxtests/psxhdrs/c11/threads/mtx_lock.c | 39 +++++++++++++++++
 .../psxtests/psxhdrs/c11/threads/mtx_timedlock.c   | 42 ++++++++++++++++++
 .../psxtests/psxhdrs/c11/threads/mtx_trylock.c     | 39 +++++++++++++++++
 .../psxtests/psxhdrs/c11/threads/mtx_unlock.c      | 39 +++++++++++++++++
 .../psxtests/psxhdrs/c11/threads/thrd_create.c     | 46 ++++++++++++++++++++
 .../psxtests/psxhdrs/c11/threads/thrd_current.c    | 37 ++++++++++++++++
 .../psxtests/psxhdrs/c11/threads/thrd_detach.c     | 47 ++++++++++++++++++++
 .../psxtests/psxhdrs/c11/threads/thrd_equal.c      | 50 ++++++++++++++++++++++
 .../psxtests/psxhdrs/c11/threads/thrd_exit.c       | 47 ++++++++++++++++++++
 .../psxtests/psxhdrs/c11/threads/thrd_join.c       | 48 +++++++++++++++++++++
 .../psxtests/psxhdrs/c11/threads/thrd_sleep.c      | 43 +++++++++++++++++++
 .../psxtests/psxhdrs/c11/threads/thrd_yield.c      | 47 ++++++++++++++++++++
 .../psxtests/psxhdrs/c11/threads/tss_create.c      | 39 +++++++++++++++++
 .../psxtests/psxhdrs/c11/threads/tss_delete.c      | 40 +++++++++++++++++
 testsuites/psxtests/psxhdrs/c11/threads/tss_get.c  | 40 +++++++++++++++++
 testsuites/psxtests/psxhdrs/c11/threads/tss_set.c  | 41 ++++++++++++++++++
 26 files changed, 1069 insertions(+)

diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am
index 13ac889..01fd04a 100644
--- a/testsuites/psxtests/Makefile.am
+++ b/testsuites/psxtests/Makefile.am
@@ -1614,6 +1614,31 @@ lib_a_SOURCES = psxhdrs/devctl/posix_devctl.c \
 	psxhdrs/syslog/openlog.c \
 	psxhdrs/syslog/setlogmask.c \
 	psxhdrs/syslog/syslog.c \
+	psxhdrs/c11/threads/call_once.c \
+	psxhdrs/c11/threads/cnd_broadcast.c \
+	psxhdrs/c11/threads/cnd_destroy.c \
+	psxhdrs/c11/threads/cnd_init.c \
+	psxhdrs/c11/threads/cnd_signal.c \
+	psxhdrs/c11/threads/cnd_timedwait.c \
+	psxhdrs/c11/threads/cnd_wait.c \
+	psxhdrs/c11/threads/mtx_init.c \
+	psxhdrs/c11/threads/mtx_destroy.c \
+	psxhdrs/c11/threads/mtx_lock.c \
+	psxhdrs/c11/threads/mtx_timedlock.c \
+	psxhdrs/c11/threads/mtx_trylock.c \
+	psxhdrs/c11/threads/mtx_unlock.c \
+	psxhdrs/c11/threads/thrd_create.c \
+	psxhdrs/c11/threads/thrd_current.c \
+	psxhdrs/c11/threads/thrd_detach.c \
+	psxhdrs/c11/threads/thrd_equal.c \
+	psxhdrs/c11/threads/thrd_exit.c \
+	psxhdrs/c11/threads/thrd_join.c \
+	psxhdrs/c11/threads/thrd_sleep.c \
+	psxhdrs/c11/threads/thrd_yield.c \
+	psxhdrs/c11/threads/tss_create.c \
+	psxhdrs/c11/threads/tss_delete.c \
+	psxhdrs/c11/threads/tss_get.c \
+	psxhdrs/c11/threads/tss_set.c \
 	psxhdrs/wchar/btowc.c \
 	psxhdrs/wchar/fgetwc.c \
 	psxhdrs/wchar/fgetws.c \
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/call_once.c b/testsuites/psxtests/psxhdrs/c11/threads/call_once.c
new file mode 100644
index 0000000..9d697d7
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/call_once.c
@@ -0,0 +1,43 @@
+/**
+ *  @file
+ *  @brief call_once() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <threads.h>
+
+int test( void );
+void do_once( void );
+
+int test( void )
+{
+  once_flag flag = ONCE_FLAG_INIT;
+
+  call_once( &flag, do_once );
+
+  return 0;
+}
+
+void do_once(void) {
+    puts( "called once" );
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/cnd_broadcast.c b/testsuites/psxtests/psxhdrs/c11/threads/cnd_broadcast.c
new file mode 100644
index 0000000..febc96c
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/cnd_broadcast.c
@@ -0,0 +1,39 @@
+/**
+ *  @file
+ *  @brief cnd_broadcast() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+
+int test( void )
+{
+  cnd_t cv;
+  int result;
+
+  cnd_init( &cv );
+  result = cnd_broadcast( &cv );
+
+  return ( result != -1 );
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/cnd_destroy.c b/testsuites/psxtests/psxhdrs/c11/threads/cnd_destroy.c
new file mode 100644
index 0000000..afeaf1c
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/cnd_destroy.c
@@ -0,0 +1,39 @@
+/**
+ *  @file
+ *  @brief cnd_destroy() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+
+int test( void )
+{
+  cnd_t cv;
+  int result;
+
+  result = cnd_init( &cv );
+  cnd_destroy( &cv );
+
+  return ( result != -1 );
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/cnd_init.c b/testsuites/psxtests/psxhdrs/c11/threads/cnd_init.c
new file mode 100644
index 0000000..5afcd1b
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/cnd_init.c
@@ -0,0 +1,38 @@
+/**
+ *  @file
+ *  @brief cnd_init() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+
+int test( void )
+{
+  cnd_t cv;
+  int result;
+
+  result = cnd_init( &cv );
+
+  return ( result != -1 );
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/cnd_signal.c b/testsuites/psxtests/psxhdrs/c11/threads/cnd_signal.c
new file mode 100644
index 0000000..0d2f20e
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/cnd_signal.c
@@ -0,0 +1,39 @@
+/**
+ *  @file
+ *  @brief cnd_signal() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+
+int test( void )
+{
+  cnd_t cv;
+  int result;
+
+  cnd_init( &cv );
+  result = cnd_signal( &cv );
+
+  return ( result != -1 );
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/cnd_timedwait.c b/testsuites/psxtests/psxhdrs/c11/threads/cnd_timedwait.c
new file mode 100644
index 0000000..7476131
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/cnd_timedwait.c
@@ -0,0 +1,44 @@
+/**
+ *  @file
+ *  @brief cnd_timedwait() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+
+int test( void )
+{
+  cnd_t cv;
+  mtx_t mtx;
+  struct timespec ts;
+  int result;
+
+  ts.tv_nsec = 0;
+
+  cnd_init( &cv );
+  mtx_init( &mtx, mtx_plain );
+  result = cnd_timedwait( &cv, &mtx, &ts );
+
+  return ( result != -1 );
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/cnd_wait.c b/testsuites/psxtests/psxhdrs/c11/threads/cnd_wait.c
new file mode 100644
index 0000000..672eef1
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/cnd_wait.c
@@ -0,0 +1,41 @@
+/**
+ *  @file
+ *  @brief cnd_wait() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+
+int test( void )
+{
+  cnd_t cv;
+  mtx_t mtx;
+  int result;
+
+  cnd_init( &cv );
+  mtx_init( &mtx, mtx_plain );
+  result = cnd_wait( &cv, &mtx );
+
+  return ( result != -1 );
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/mtx_destroy.c b/testsuites/psxtests/psxhdrs/c11/threads/mtx_destroy.c
new file mode 100644
index 0000000..dc621c9
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/mtx_destroy.c
@@ -0,0 +1,39 @@
+/**
+ *  @file
+ *  @brief mtx_destroy() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+
+int test( void )
+{
+  mtx_t mtx;
+  int result;
+
+  result = mtx_init( &mtx, mtx_plain );
+  mtx_destroy( &mtx );
+
+  return ( result != -1 );
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/mtx_init.c b/testsuites/psxtests/psxhdrs/c11/threads/mtx_init.c
new file mode 100644
index 0000000..4f4d0e3
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/mtx_init.c
@@ -0,0 +1,38 @@
+/**
+ *  @file
+ *  @brief mtx_init() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+
+int test( void )
+{
+  mtx_t mtx;
+  int result;
+
+  result = mtx_init( &mtx, mtx_plain );
+
+  return ( result != -1 );
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/mtx_lock.c b/testsuites/psxtests/psxhdrs/c11/threads/mtx_lock.c
new file mode 100644
index 0000000..c336c07
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/mtx_lock.c
@@ -0,0 +1,39 @@
+/**
+ *  @file
+ *  @brief mtx_lock() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+
+int test( void )
+{
+  mtx_t mtx;
+  int result;
+
+  mtx_init( &mtx, mtx_plain );
+  result = mtx_lock( &mtx );
+
+  return ( result != -1 );
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/mtx_timedlock.c b/testsuites/psxtests/psxhdrs/c11/threads/mtx_timedlock.c
new file mode 100644
index 0000000..677b2d1
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/mtx_timedlock.c
@@ -0,0 +1,42 @@
+/**
+ *  @file
+ *  @brief mtx_timedlock() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+
+int test( void )
+{
+  mtx_t mtx;
+  struct timespec time_point;
+  int result;
+
+  time_point.tv_nsec = 0;
+
+  mtx_init( &mtx, mtx_plain );
+  result = mtx_timedlock( &mtx, &time_point );
+
+  return ( result != -1 );
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/mtx_trylock.c b/testsuites/psxtests/psxhdrs/c11/threads/mtx_trylock.c
new file mode 100644
index 0000000..314ce38
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/mtx_trylock.c
@@ -0,0 +1,39 @@
+/**
+ *  @file
+ *  @brief mtx_trylock() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+
+int test( void )
+{
+  mtx_t mtx;
+  int result;
+
+  mtx_init( &mtx, mtx_plain );
+  result = mtx_trylock( &mtx );
+
+  return ( result != -1 );
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/mtx_unlock.c b/testsuites/psxtests/psxhdrs/c11/threads/mtx_unlock.c
new file mode 100644
index 0000000..7b10c14
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/mtx_unlock.c
@@ -0,0 +1,39 @@
+/**
+ *  @file
+ *  @brief mtx_unlock() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+
+int test( void )
+{
+  mtx_t mtx;
+  int result;
+
+  mtx_init( &mtx, mtx_plain );
+  result = mtx_unlock( &mtx );
+
+  return ( result != -1 );
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/thrd_create.c b/testsuites/psxtests/psxhdrs/c11/threads/thrd_create.c
new file mode 100644
index 0000000..397b186
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/thrd_create.c
@@ -0,0 +1,46 @@
+/**
+ *  @file
+ *  @brief thrd_create() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+int th_func( void *arg );
+
+int test( void )
+{
+  thrd_t th;
+  int n = 1;
+  int result;
+
+  result = thrd_create( &th, th_func, &n );
+
+  return ( result != -1 );
+}
+
+int th_func( void *arg )
+{
+    ++*(int*)arg;
+    return 0;
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/thrd_current.c b/testsuites/psxtests/psxhdrs/c11/threads/thrd_current.c
new file mode 100644
index 0000000..aef6523
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/thrd_current.c
@@ -0,0 +1,37 @@
+/**
+ *  @file
+ *  @brief thrd_current() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+
+int test( void )
+{
+  thrd_t th;
+
+  th = thrd_current();
+
+  return ( th != 0 );
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/thrd_detach.c b/testsuites/psxtests/psxhdrs/c11/threads/thrd_detach.c
new file mode 100644
index 0000000..c5d41db
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/thrd_detach.c
@@ -0,0 +1,47 @@
+/**
+ *  @file
+ *  @brief thrd_detach() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+int th_func( void *arg );
+
+int test( void )
+{
+  thrd_t th;
+  int n = 1;
+  int result;
+
+  thrd_create( &th, th_func, &n );
+  result = thrd_detach( th );
+
+  return ( result != -1 );
+}
+
+int th_func( void *arg )
+{
+    ++*(int*)arg;
+    return 0;
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/thrd_equal.c b/testsuites/psxtests/psxhdrs/c11/threads/thrd_equal.c
new file mode 100644
index 0000000..a89df70
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/thrd_equal.c
@@ -0,0 +1,50 @@
+/**
+ *  @file
+ *  @brief thrd_equal() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+int th_func( void *arg );
+
+int test( void )
+{
+  thrd_t lhs;
+  thrd_t rhs;
+  int ln = 1;
+  int rn = 1;
+  int result;
+
+  thrd_create( &lhs, th_func, &ln );
+  thrd_create( &rhs, th_func, &rn );
+  result = thrd_equal( lhs, rhs );
+
+  return ( result != -1 );
+}
+
+int th_func( void *arg )
+{
+    ++*(int*)arg;
+    return 0;
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/thrd_exit.c b/testsuites/psxtests/psxhdrs/c11/threads/thrd_exit.c
new file mode 100644
index 0000000..59a1f97
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/thrd_exit.c
@@ -0,0 +1,47 @@
+/**
+ *  @file
+ *  @brief thrd_exit() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+int th_func( void *arg );
+
+int test( void )
+{
+  thrd_t th;
+  int n = 1;
+  int result;
+
+  result = thrd_create( &th, th_func, &n );
+  thrd_exit( 1 );
+
+  return ( result != -1 );
+}
+
+int th_func( void *arg )
+{
+    ++*(int*)arg;
+    return 0;
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/thrd_join.c b/testsuites/psxtests/psxhdrs/c11/threads/thrd_join.c
new file mode 100644
index 0000000..4d40c13
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/thrd_join.c
@@ -0,0 +1,48 @@
+/**
+ *  @file
+ *  @brief thrd_join() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+int th_func( void *arg );
+
+int test( void )
+{
+  thrd_t th;
+  int n = 1;
+  int res = 1;
+  int result;
+
+  thrd_create( &th, th_func, &n );
+  result = thrd_join( th, &res );
+
+  return ( result != -1 );
+}
+
+int th_func( void *arg )
+{
+    ++*(int*)arg;
+    return 0;
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/thrd_sleep.c b/testsuites/psxtests/psxhdrs/c11/threads/thrd_sleep.c
new file mode 100644
index 0000000..f0040dd
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/thrd_sleep.c
@@ -0,0 +1,43 @@
+/**
+ *  @file
+ *  @brief thrd_sleep() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+int th_func( void *arg );
+
+int test( void )
+{
+  struct timespec duration;
+  struct timespec remaining;
+  int result;
+
+  duration.tv_nsec = 0;
+  remaining.tv_nsec = 1;
+
+  result = thrd_sleep( &duration, &remaining );
+
+  return ( result != -1 );
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/thrd_yield.c b/testsuites/psxtests/psxhdrs/c11/threads/thrd_yield.c
new file mode 100644
index 0000000..11c2d79
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/thrd_yield.c
@@ -0,0 +1,47 @@
+/**
+ *  @file
+ *  @brief thrd_yield() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+int th_func( void *arg );
+
+int test( void )
+{
+  thrd_t th;
+  int n = 1;
+  int result;
+
+  result = thrd_create( &th, th_func, &n );
+  thrd_yield();
+
+  return ( result != -1 );
+}
+
+int th_func( void *arg )
+{
+    ++*(int*)arg;
+    return 0;
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/tss_create.c b/testsuites/psxtests/psxhdrs/c11/threads/tss_create.c
new file mode 100644
index 0000000..e9a3ef3
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/tss_create.c
@@ -0,0 +1,39 @@
+/**
+ *  @file
+ *  @brief tss_create() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+
+int test( void )
+{
+  tss_t key;
+  tss_dtor_t destructor = NULL;
+  int result;
+
+  result = tss_create( &key, destructor );
+
+  return ( result != -1 );
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/tss_delete.c b/testsuites/psxtests/psxhdrs/c11/threads/tss_delete.c
new file mode 100644
index 0000000..4ceb1ae
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/tss_delete.c
@@ -0,0 +1,40 @@
+/**
+ *  @file
+ *  @brief tss_delete() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+
+int test( void )
+{
+  tss_t key;
+  tss_dtor_t destructor = NULL;
+  int result;
+
+  result = tss_create( &key, destructor );
+  tss_delete( key );
+
+  return ( result != -1 );
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/tss_get.c b/testsuites/psxtests/psxhdrs/c11/threads/tss_get.c
new file mode 100644
index 0000000..9630a63
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/tss_get.c
@@ -0,0 +1,40 @@
+/**
+ *  @file
+ *  @brief tss_get() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <threads.h>
+
+int test( void );
+
+int test( void )
+{
+  tss_t key;
+  tss_dtor_t destructor = NULL;
+  void *get;
+
+  tss_create( &key, destructor );
+  get = tss_get( key );
+
+  return ( get != NULL );
+}
diff --git a/testsuites/psxtests/psxhdrs/c11/threads/tss_set.c b/testsuites/psxtests/psxhdrs/c11/threads/tss_set.c
new file mode 100644
index 0000000..7b0ac3d
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/c11/threads/tss_set.c
@@ -0,0 +1,41 @@
+/**
+ *  @file
+ *  @brief tss_set() API Conformance Test
+ */
+
+/*
+ *  COPYRIGHT (c) 2018.
+ *  Himanshu Sekhar Nayak
+ *
+ *  Permission to use, copy, modify, and/or distribute this software
+ *  for any purpose with or without fee is hereby granted.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
+ *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <threads.h>
+
+int test( void );
+
+int test( void )
+{
+  tss_t key;
+  tss_dtor_t destructor = NULL;
+  int result;
+
+  tss_create( &key, destructor );
+  result = tss_set( key, malloc( 4 ) );
+
+  return ( result != -1 );
+}



More information about the vc mailing list