1 //===----------------------------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // UNSUPPORTED: libcpp-has-no-threads 10 11 // <atomic> 12 13 // typedef enum memory_order 14 // { 15 // memory_order_relaxed, memory_order_consume, memory_order_acquire, 16 // memory_order_release, memory_order_acq_rel, memory_order_seq_cst 17 // } memory_order; 18 19 #include <atomic> 20 #include <cassert> 21 22 int main(int, char**) 23 { 24 assert(static_cast<int>(std::memory_order_relaxed) == 0); 25 assert(static_cast<int>(std::memory_order_consume) == 1); 26 assert(static_cast<int>(std::memory_order_acquire) == 2); 27 assert(static_cast<int>(std::memory_order_release) == 3); 28 assert(static_cast<int>(std::memory_order_acq_rel) == 4); 29 assert(static_cast<int>(std::memory_order_seq_cst) == 5); 30 31 std::memory_order o = std::memory_order_seq_cst; 32 assert(static_cast<int>(o) == 5); 33 34 return 0; 35 } 36