Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libc++] Change memory_order to an enum class
This implements P0439R0. Thanks to Zoe Carver for the patch. Differential Revision: https://reviews.llvm.org/D58201 llvm-svn: 355403
- Loading branch information
Showing
4 changed files
with
115 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
libcxx/test/std/atomics/atomics.order/memory_order_new.pass.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// UNSUPPORTED: libcpp-has-no-threads, c++98, c++03, c++11, c++14, c++17 | ||
|
||
#include <atomic> | ||
|
||
int main(int, char**) | ||
{ | ||
static_assert(std::memory_order_relaxed == std::memory_order::relaxed); | ||
static_assert(std::memory_order_consume == std::memory_order::consume); | ||
static_assert(std::memory_order_acquire == std::memory_order::acquire); | ||
static_assert(std::memory_order_release == std::memory_order::release); | ||
static_assert(std::memory_order_acq_rel == std::memory_order::acq_rel); | ||
static_assert(std::memory_order_seq_cst == std::memory_order::seq_cst); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters