---
.../winpthreads/tests/Makefile.am | 73 ++++++++++++-------
.../winpthreads/tests/pthread_once/once1.c | 8 +-
.../winpthreads/tests/pthread_once/once2.c | 8 +-
.../winpthreads/tests/pthread_once/once3.c | 6 ++
.../winpthreads/tests/pthread_once/once4.c | 8 +-
5 files changed, 73 insertions(+), 30 deletions(-)
diff --git a/mingw-w64-libraries/winpthreads/tests/Makefile.am
b/mingw-w64-libraries/winpthreads/tests/Makefile.am
index 80878994..3dbd173a 100644
--- a/mingw-w64-libraries/winpthreads/tests/Makefile.am
+++ b/mingw-w64-libraries/winpthreads/tests/Makefile.am
@@ -147,37 +147,56 @@ check_PROGRAMS = \
pthread_mutex/recursive-trylock \
pthread_mutex/recursive-trylock-recursive \
pthread_mutex/recursive-unlock \
- pthread_once/once1 \
- pthread_once/once2 \
- pthread_once/once3 \
- pthread_once/once4 \
- pthread_rwlock/rwlock1 \
- pthread_rwlock/rwlock2 \
- pthread_rwlock/rwlock2_t \
- pthread_rwlock/rwlock3 \
- pthread_rwlock/rwlock3_t \
- pthread_rwlock/rwlock4 \
- pthread_rwlock/rwlock4_t \
- pthread_rwlock/rwlock5 \
- pthread_rwlock/rwlock5_t \
- pthread_rwlock/rwlock6 \
- pthread_rwlock/rwlock6_t \
- pthread_rwlock/rwlock6_t2 \
- pthread_rwlock/rwlock7 \
- pthread_rwlock/rwlock8 \
+ pthread_once/once1 \
+ pthread_once/once2 \
+ pthread_once/once3 \
+ pthread_once/once4 \
+ pthread_once/once1_downlevel \
+ pthread_once/once2_downlevel \
+ pthread_once/once3_downlevel \
+ pthread_once/once4_downlevel \
+ pthread_rwlock/rwlock1 \
+ pthread_rwlock/rwlock2 \
+ pthread_rwlock/rwlock2_t \
+ pthread_rwlock/rwlock3 \
+ pthread_rwlock/rwlock3_t \
+ pthread_rwlock/rwlock4 \
+ pthread_rwlock/rwlock4_t \
+ pthread_rwlock/rwlock5 \
+ pthread_rwlock/rwlock5_t \
+ pthread_rwlock/rwlock6 \
+ pthread_rwlock/rwlock6_t \
+ pthread_rwlock/rwlock6_t2 \
+ pthread_rwlock/rwlock7 \
+ pthread_rwlock/rwlock8 \
pthread_spinlock/spinlock-basic \
pthread_spinlock/spinlock-threaded \
pthread_spinlock/spinlock-static-basic \
pthread_spinlock/spinlock-static-race \
- pthread_tls/tsd1 \
- pthread_tls/tsd2 \
- sched/priority1 \
- sched/priority2 \
- semaphore/semaphore1 \
- semaphore/semaphore2 \
- semaphore/semaphore3 \
- semaphore/semaphore4 \
- semaphore/semaphore4t \
+ pthread_tls/tsd1 \
+ pthread_tls/tsd2 \
+ sched/priority1 \
+ sched/priority2 \
+ semaphore/semaphore1 \
+ semaphore/semaphore2 \
+ semaphore/semaphore3 \
+ semaphore/semaphore4 \
+ semaphore/semaphore4t \
semaphore/semaphore5
TESTS = $(check_PROGRAMS)
+
+pthread_once_once1_downlevel_SOURCES = pthread_once/once1.c
+pthread_once_once2_downlevel_SOURCES = pthread_once/once2.c
+pthread_once_once3_downlevel_SOURCES = pthread_once/once3.c
+pthread_once_once4_downlevel_SOURCES = pthread_once/once4.c
+
+pthread_once_once1_downlevel_CFLAGS = -DTEST_DOWNLEVEL
+pthread_once_once2_downlevel_CFLAGS = -DTEST_DOWNLEVEL
+pthread_once_once3_downlevel_CFLAGS = -DTEST_DOWNLEVEL
+pthread_once_once4_downlevel_CFLAGS = -DTEST_DOWNLEVEL
+
+pthread_once_once1_downlevel_LDFLAGS = -static
+pthread_once_once2_downlevel_LDFLAGS = -static
+pthread_once_once3_downlevel_LDFLAGS = -static
+pthread_once_once4_downlevel_LDFLAGS = -static
diff --git a/mingw-w64-libraries/winpthreads/tests/pthread_once/once1.c
b/mingw-w64-libraries/winpthreads/tests/pthread_once/once1.c
index daec112d..c24d982c 100644
--- a/mingw-w64-libraries/winpthreads/tests/pthread_once/once1.c
+++ b/mingw-w64-libraries/winpthreads/tests/pthread_once/once1.c
@@ -64,7 +64,13 @@ int
main()
{
pthread_t t1, t2;
-
+
+#ifdef TEST_DOWNLEVEL
+ _pthread_wait_on_address = NULL;
+ _pthread_wake_by_address_single = NULL;
+ _pthread_wake_by_address_all = NULL;
+#endif
+
assert(pthread_create(&t1, NULL, mythread, NULL) == 0);
assert(pthread_create(&t2, NULL, mythread, NULL) == 0);
diff --git a/mingw-w64-libraries/winpthreads/tests/pthread_once/once2.c
b/mingw-w64-libraries/winpthreads/tests/pthread_once/once2.c
index 728a7c55..5722883e 100644
--- a/mingw-w64-libraries/winpthreads/tests/pthread_once/once2.c
+++ b/mingw-w64-libraries/winpthreads/tests/pthread_once/once2.c
@@ -82,7 +82,13 @@ main()
{
pthread_t t[NUM_THREADS][NUM_ONCE];
int i, j;
-
+
+#ifdef TEST_DOWNLEVEL
+ _pthread_wait_on_address = NULL;
+ _pthread_wake_by_address_single = NULL;
+ _pthread_wake_by_address_all = NULL;
+#endif
+
InitializeCriticalSection(&numThreads.cs);
InitializeCriticalSection(&numOnce.cs);
diff --git a/mingw-w64-libraries/winpthreads/tests/pthread_once/once3.c
b/mingw-w64-libraries/winpthreads/tests/pthread_once/once3.c
index 7ad92de8..cdf1fe1b 100644
--- a/mingw-w64-libraries/winpthreads/tests/pthread_once/once3.c
+++ b/mingw-w64-libraries/winpthreads/tests/pthread_once/once3.c
@@ -99,6 +99,12 @@ main()
pthread_t t[NUM_THREADS][NUM_ONCE];
int i, j;
+#ifdef TEST_DOWNLEVEL
+ _pthread_wait_on_address = NULL;
+ _pthread_wake_by_address_single = NULL;
+ _pthread_wake_by_address_all = NULL;
+#endif
+
//printf ("Is ok\n");
//return 1;
InitializeCriticalSection(&numThreads.cs);
diff --git a/mingw-w64-libraries/winpthreads/tests/pthread_once/once4.c
b/mingw-w64-libraries/winpthreads/tests/pthread_once/once4.c
index 7002bb57..ec64c6ea 100644
--- a/mingw-w64-libraries/winpthreads/tests/pthread_once/once4.c
+++ b/mingw-w64-libraries/winpthreads/tests/pthread_once/once4.c
@@ -139,7 +139,13 @@ main()
{
pthread_t t[NUM_THREADS][NUM_ONCE];
int i, j, cpus;
-
+
+#ifdef TEST_DOWNLEVEL
+ _pthread_wait_on_address = NULL;
+ _pthread_wake_by_address_single = NULL;
+ _pthread_wake_by_address_all = NULL;
+#endif
+
//fprintf(stderr, "Skipped (hangs)\n");
//return 1;
InitializeCriticalSection(&print_lock);
--
2.55.0.windows.5
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public