[libcxx-commits] [libcxx] 8777665 - [libc++][test] Don't violate precondition [atomics.flag]/6

Casey Carter via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 19 17:16:49 PDT 2020


Post-commit review: shout if you'd prefer that I remove this code for
libc++ as well.

On Mon, Oct 19, 2020 at 5:14 PM Casey Carter via libcxx-commits <
libcxx-commits at lists.llvm.org> wrote:

>
> Author: Casey Carter
> Date: 2020-10-19T17:14:01-07:00
> New Revision: 877766573b21a72b04371b8790c0828dc7176f5d
>
> URL:
> https://github.com/llvm/llvm-project/commit/877766573b21a72b04371b8790c0828dc7176f5d
> DIFF:
> https://github.com/llvm/llvm-project/commit/877766573b21a72b04371b8790c0828dc7176f5d.diff
>
> LOG: [libc++][test] Don't violate precondition [atomics.flag]/6
>
> ... which forbids passing `memory_order_release` or `memory_order_acq_rel`
> to either overload of `atomic_flag_test_explicit`.
>
> Added:
>
>
> Modified:
>     libcxx/test/std/atomics/atomics.flag/atomic_flag_test_explicit.pass.cpp
>
> Removed:
>
>
>
>
> ################################################################################
> diff  --git
> a/libcxx/test/std/atomics/atomics.flag/atomic_flag_test_explicit.pass.cpp
> b/libcxx/test/std/atomics/atomics.flag/atomic_flag_test_explicit.pass.cpp
> index 45ac737b5984..af3665f13300 100644
> ---
> a/libcxx/test/std/atomics/atomics.flag/atomic_flag_test_explicit.pass.cpp
> +++
> b/libcxx/test/std/atomics/atomics.flag/atomic_flag_test_explicit.pass.cpp
> @@ -43,6 +43,7 @@ int main(int, char**)
>          assert(f.test_and_set() == 0);
>          assert(atomic_flag_test_explicit(&f, std::memory_order_acquire)
> == 1);
>      }
> +#ifdef _LIBCPP_VERSION // Don't violate precondition [atomics.flag]/6
>      {
>          std::atomic_flag f;
>          f.clear();
> @@ -57,6 +58,7 @@ int main(int, char**)
>          assert(f.test_and_set() == 0);
>          assert(atomic_flag_test_explicit(&f, std::memory_order_acq_rel)
> == 1);
>      }
> +#endif // _LIBCPP_VERSION
>      {
>          std::atomic_flag f;
>          f.clear();
> @@ -85,6 +87,7 @@ int main(int, char**)
>          assert(f.test_and_set() == 0);
>          assert(atomic_flag_test_explicit(&f, std::memory_order_acquire)
> == 1);
>      }
> +#ifdef _LIBCPP_VERSION // Don't violate precondition [atomics.flag]/6
>      {
>          volatile std::atomic_flag f;
>          f.clear();
> @@ -99,6 +102,7 @@ int main(int, char**)
>          assert(f.test_and_set() == 0);
>          assert(atomic_flag_test_explicit(&f, std::memory_order_acq_rel)
> == 1);
>      }
> +#endif // _LIBCPP_VERSION
>      {
>          volatile std::atomic_flag f;
>          f.clear();
>
>
>
> _______________________________________________
> libcxx-commits mailing list
> libcxx-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201019/7c8a3ed9/attachment.html>


More information about the libcxx-commits mailing list