libstdc++: Fix condition for gthreads-timed effective-target
authorJonathan Wakely <jwakely@redhat.com>
Thu, 17 Dec 2020 14:28:17 +0000 (14:28 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 17 Dec 2020 16:16:37 +0000 (16:16 +0000)
The refactoring in r11-5500 altered the condition for the gthreads-timed
test from #if to #ifdef. For some reason that macro is always defined,
rather than being defined to 1 or undefined like most of our autoconf
macros. That means the test always passes now, even for targets where
the macro is defined to 0 (specifically, Darwin). That causes some tests
to FAIL when they should have been UNSUPPORTED.

This restores the previous behaviour.

libstdc++-v3/ChangeLog:

* testsuite/lib/libstdc++.exp (check_v3_target_gthreads_timed):
Fix condition for _GTHREAD_USE_MUTEX_TIMEDLOCK test.

libstdc++-v3/testsuite/lib/libstdc++.exp

index aeb881f91a6b0eb2360bfb0033459279e43bd33f..b7d7b906de41cbecbe2753f73ef636d26727b6de 100644 (file)
@@ -1129,7 +1129,7 @@ proc check_effective_target_gthreads { } {
 proc check_v3_target_gthreads_timed { } {
     return [check_v3_target_prop_cached et_gthreads_timed {
        if [check_v3_target_gthreads] {
-           set cond "defined _GTHREAD_USE_MUTEX_TIMEDLOCK"
+           set cond "_GTHREAD_USE_MUTEX_TIMEDLOCK"
            return [v3_check_preprocessor_condition gthreads_timed $cond]
        } else {
            return 0