pthread: Move robust mutex tests from nptl to sysdeps/pthread
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 16 Feb 2020 14:30:17 +0000 (14:30 +0000)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 16 Feb 2020 14:43:54 +0000 (14:43 +0000)
tst-robust8.c prints some mutex internals for nptl debugging, this
needed to be made conditioned by getting built with nptl.

15 files changed:
nptl/Makefile
nptl/pthreadP.h
sysdeps/htl/pthreadP.h
sysdeps/mach/hurd/i386/Makefile
sysdeps/pthread/Makefile
sysdeps/pthread/tst-robust1.c [moved from nptl/tst-robust1.c with 100% similarity]
sysdeps/pthread/tst-robust10.c [moved from nptl/tst-robust10.c with 100% similarity]
sysdeps/pthread/tst-robust2.c [moved from nptl/tst-robust2.c with 100% similarity]
sysdeps/pthread/tst-robust3.c [moved from nptl/tst-robust3.c with 100% similarity]
sysdeps/pthread/tst-robust4.c [moved from nptl/tst-robust4.c with 100% similarity]
sysdeps/pthread/tst-robust5.c [moved from nptl/tst-robust5.c with 100% similarity]
sysdeps/pthread/tst-robust6.c [moved from nptl/tst-robust6.c with 100% similarity]
sysdeps/pthread/tst-robust7.c [moved from nptl/tst-robust7.c with 100% similarity]
sysdeps/pthread/tst-robust8.c [moved from nptl/tst-robust8.c with 99% similarity]
sysdeps/pthread/tst-robust9.c [moved from nptl/tst-robust9.c with 100% similarity]

index fcdc72a..b25d34b 100644 (file)
@@ -240,8 +240,6 @@ tests = tst-attr2 tst-attr3 tst-default-attr \
        tst-mutexpi5 tst-mutexpi5a tst-mutexpi6 tst-mutexpi7 tst-mutexpi7a \
        tst-mutexpi9 \
        tst-cond11 tst-cond20 tst-cond21 tst-cond22 tst-cond26 tst-cond27 \
-       tst-robust1 tst-robust2 tst-robust3 tst-robust4 tst-robust5 \
-       tst-robust6 tst-robust7 tst-robust8 tst-robust9 \
        tst-robustpi1 tst-robustpi2 tst-robustpi3 tst-robustpi4 tst-robustpi5 \
        tst-robustpi6 tst-robustpi7 tst-robustpi8 tst-robustpi9 \
        tst-rwlock2 tst-rwlock2a tst-rwlock2b tst-rwlock3 \
@@ -297,7 +295,7 @@ tests = tst-attr2 tst-attr3 tst-default-attr \
        tst-initializers1 $(addprefix tst-initializers1-,\
                            c89 gnu89 c99 gnu99 c11 gnu11) \
        tst-bad-schedattr \
-       tst-thread_local1 tst-mutex-errorcheck tst-robust10 \
+       tst-thread_local1 tst-mutex-errorcheck \
        tst-robust-fork tst-create-detached tst-memstream \
        tst-thread-exit-clobber tst-minstack-cancel tst-minstack-exit \
        tst-minstack-throw \
index 7e0ab8e..df4b1a0 100644 (file)
@@ -19,6 +19,8 @@
 #ifndef _PTHREADP_H
 #define _PTHREADP_H    1
 
+#define __PTHREAD_NPTL
+
 #include <pthread.h>
 #include <setjmp.h>
 #include <stdbool.h>
index 2bb4baa..1726ebb 100644 (file)
@@ -19,6 +19,8 @@
 #ifndef _PTHREADP_H
 #define _PTHREADP_H    1
 
+#define __PTHREAD_HTL
+
 #include <pthread.h>
 
 /* Attribute to indicate thread creation was issued from C11 thrd_create.  */
index e6e665b..068f7d0 100644 (file)
@@ -97,8 +97,8 @@ ifeq ($(subdir),mach)
 test-xfail-check-abi-libmachuser = yes
 endif
 
-# For bug 25521
 ifeq ($(subdir),htl)
+# For bug 25521
 test-xfail-tst-mutex4 = yes
 test-xfail-tst-cond4 = yes
 test-xfail-tst-cond6 = yes
@@ -109,20 +109,26 @@ test-xfail-tst-rwlock4 = yes
 test-xfail-tst-rwlock12 = yes
 test-xfail-tst-sem3 = yes
 test-xfail-tst-barrier2 = yes
-endif
 
 # For bug 25522
-ifeq ($(subdir),htl)
 test-xfail-tst-cond24 = yes
 test-xfail-tst-cond25 = yes
-endif
 
 # For bug 25524
-ifeq ($(subdir),htl)
 test-xfail-tst-sem4 = yes
 test-xfail-tst-sem7 = yes
 test-xfail-tst-sem8 = yes
 test-xfail-tst-sem9 = yes
+
+# For bug 25563
+test-xfail-tst-robust1 = yes
+test-xfail-tst-robust2 = yes
+test-xfail-tst-robust3 = yes
+test-xfail-tst-robust4 = yes
+test-xfail-tst-robust5 = yes
+test-xfail-tst-robust6 = yes
+test-xfail-tst-robust7 = yes
+test-xfail-tst-robust9 = yes
 endif
 
 ifeq ($(subdir),elf)
index 396f2b1..b6491d6 100644 (file)
@@ -55,6 +55,8 @@ tests += tst-cnd-basic tst-mtx-trylock tst-cnd-broadcast \
         tst-key1 tst-key2 tst-key3 tst-key4 \
         tst-mutex1 tst-mutex2 tst-mutex3 tst-mutex4 tst-mutex6 tst-mutex10 \
         tst-once1 tst-once2 tst-once3 tst-once4 \
+        tst-robust1 tst-robust2 tst-robust3 tst-robust4 tst-robust5 \
+        tst-robust6 tst-robust7 tst-robust8 tst-robust9 tst-robust10 \
         tst-rwlock1 tst-rwlock4 tst-rwlock5 tst-rwlock13 tst-rwlock16 \
         tst-rwlock-tryrdlock-stall tst-rwlock-trywrlock-stall \
         tst-sem1 tst-sem2 tst-sem3 tst-sem4 tst-sem6 tst-sem7 \
similarity index 99%
rename from nptl/tst-robust8.c
rename to sysdeps/pthread/tst-robust8.c
index f6969a4..27dd53d 100644 (file)
@@ -8,6 +8,7 @@
 #include <sys/mman.h>
 #include <sys/wait.h>
 
+#include <pthreadP.h>
 
 
 
@@ -252,7 +253,9 @@ do_test (void)
            {
              printf ("mutex_destroy %d in round %d failed with %d\n",
                      n + 1, round, e);
+#ifdef __PTHREAD_NPTL
              printf("nusers = %d\n", (int) map[n].__data.__nusers);
+#endif
              return 1;
            }
        }