From daf43ed80042f511c53635d7163f747b47d032e7 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Wed, 27 Mar 2019 15:50:34 +0000 Subject: [PATCH] [libc++] Add proper XFAILs for shared_mutex tests Dylib support for shared_mutex was added in macOS 10.12, so the tests should be XFAILed accordingly instead of being completely disabled whenever availability is enabled. rdar://problem/48769104 llvm-svn: 357079 --- .../thread.mutex/thread.lock/thread.lock.shared/lit.local.cfg | 2 -- .../thread.lock.shared.cons/default.pass.cpp | 1 + .../thread.lock.shared.cons/move_assign.pass.cpp | 1 + .../thread.lock.shared.cons/move_ctor.pass.cpp | 1 + .../thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp | 1 + .../thread.lock.shared.cons/mutex_adopt_lock.pass.cpp | 1 + .../thread.lock.shared.cons/mutex_defer_lock.pass.cpp | 1 + .../thread.lock.shared.cons/mutex_duration.pass.cpp | 1 + .../thread.lock.shared.cons/mutex_time_point.pass.cpp | 1 + .../thread.lock.shared.cons/mutex_try_to_lock.pass.cpp | 1 + .../thread.lock.shared.locking/lock.pass.cpp | 1 + .../thread.lock.shared/thread.lock.shared.obs/mutex.pass.cpp | 1 + .../thread.lock.shared.obs/op_bool.pass.cpp | 1 + .../thread.lock.shared.obs/owns_lock.pass.cpp | 1 + libcxx/utils/libcxx/test/config.py | 4 ++++ 15 files changed, 17 insertions(+), 2 deletions(-) delete mode 100644 libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/lit.local.cfg diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/lit.local.cfg b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/lit.local.cfg deleted file mode 100644 index fd3dc778c8ce..000000000000 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/lit.local.cfg +++ /dev/null @@ -1,2 +0,0 @@ -if 'availability' in config.available_features: - config.unsupported = True diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp index 0543ae72e82f..dfa6ccb14b90 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/default.pass.cpp @@ -8,6 +8,7 @@ // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03, c++11 +// XFAIL: dylib-has-no-shared_mutex // diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp index 999d65f028b3..616375ae1460 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_assign.pass.cpp @@ -8,6 +8,7 @@ // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03, c++11 +// XFAIL: dylib-has-no-shared_mutex // diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_ctor.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_ctor.pass.cpp index 1f61e21fbcf0..ebaa3b69bbc1 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_ctor.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/move_ctor.pass.cpp @@ -8,6 +8,7 @@ // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03, c++11 +// XFAIL: dylib-has-no-shared_mutex // diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp index 14c084f008dd..d35a2490bdcb 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp @@ -8,6 +8,7 @@ // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03, c++11 +// XFAIL: dylib-has-no-shared_mutex // FLAKY_TEST. diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp index 86d54b5083bf..924ffed7d614 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp @@ -8,6 +8,7 @@ // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03, c++11 +// XFAIL: dylib-has-no-shared_mutex // diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp index 5a085d2e6ae1..afe2821e6c8b 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp @@ -8,6 +8,7 @@ // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03, c++11 +// XFAIL: dylib-has-no-shared_mutex // diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_duration.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_duration.pass.cpp index 3228f938f903..c58e921882cf 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_duration.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_duration.pass.cpp @@ -8,6 +8,7 @@ // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03, c++11 +// XFAIL: dylib-has-no-shared_mutex // FLAKY_TEST. diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_time_point.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_time_point.pass.cpp index f62e739443a5..086cb484ab2e 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_time_point.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_time_point.pass.cpp @@ -8,6 +8,7 @@ // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03, c++11 +// XFAIL: dylib-has-no-shared_mutex // FLAKY_TEST. diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_try_to_lock.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_try_to_lock.pass.cpp index 7dd7c16fe5bc..0894648014bb 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_try_to_lock.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_try_to_lock.pass.cpp @@ -8,6 +8,7 @@ // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03, c++11 +// XFAIL: dylib-has-no-shared_mutex // FLAKY_TEST. diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp index 5f084b21259f..2d6ebe51092b 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp @@ -8,6 +8,7 @@ // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03, c++11 +// XFAIL: dylib-has-no-shared_mutex // FLAKY_TEST. diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/mutex.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/mutex.pass.cpp index 867bae0e3715..6bbff79b7bcf 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/mutex.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/mutex.pass.cpp @@ -8,6 +8,7 @@ // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03, c++11 +// XFAIL: dylib-has-no-shared_mutex // diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp index 82d737ee5e59..b3b0165ac39c 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp @@ -8,6 +8,7 @@ // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03, c++11 +// XFAIL: dylib-has-no-shared_mutex // diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/owns_lock.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/owns_lock.pass.cpp index f949684e834d..f401afad545b 100644 --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/owns_lock.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/owns_lock.pass.cpp @@ -8,6 +8,7 @@ // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03, c++11 +// XFAIL: dylib-has-no-shared_mutex // diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py index b1d0736027fe..53f2507e72bc 100644 --- a/libcxx/utils/libcxx/test/config.py +++ b/libcxx/utils/libcxx/test/config.py @@ -1145,6 +1145,10 @@ class Configuration(object): # features are enabled/disabled. Otherwise, disable availability markup, # which is not relevant for non-shipped flavors of libc++. if self.use_system_cxx_lib: + # Dylib support for shared_mutex was added in macosx10.12. + if name == 'macosx' and version in ('10.%s' % v for v in range(7, 12)): + self.config.available_features.add('dylib-has-no-shared_mutex') + self.lit_config.note("shared_mutex is not supported by the deployment target") # Throwing bad_optional_access, bad_variant_access and bad_any_cast is # supported starting in macosx10.14. if name == 'macosx' and version in ('10.%s' % v for v in range(7, 14)):