13acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org//===----------------------------------------------------------------------===// 23acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org// 33acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org// The LLVM Compiler Infrastructure 43acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org// 53acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org// This file is dual licensed under the MIT and the University of Illinois Open 63acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org// Source Licenses. See LICENSE.TXT for details. 73acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org// 83acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org//===----------------------------------------------------------------------===// 93acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org 103acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org// <atomic> 113acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org 123acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org// typedef enum memory_order 133acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org// { 143acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org// memory_order_relaxed, memory_order_consume, memory_order_acquire, 153acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org// memory_order_release, memory_order_acq_rel, memory_order_seq_cst 163acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org// } memory_order; 173acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org 183acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org#include <atomic> 193acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org#include <cassert> 203acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org 213acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.orgint main() 223acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org{ 233acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org assert(std::memory_order_relaxed == 0); 243acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org assert(std::memory_order_consume == 1); 253acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org assert(std::memory_order_acquire == 2); 263acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org assert(std::memory_order_release == 3); 273acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org assert(std::memory_order_acq_rel == 4); 283acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org assert(std::memory_order_seq_cst == 5); 293acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org std::memory_order o = std::memory_order_seq_cst; 303acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org assert(o == 5); 313acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org} 323acaa1f87fbffb413fcddb67d10427132a7ff922phoglund@webrtc.org