[cfe-commits] [libcxx] r114966 - in /libcxx/trunk: include/atomic test/atomics/atomics.general/nothing_to_do.pass.cpp test/atomics/atomics.order/kill_dependency.pass.cpp test/atomics/atomics.order/memory_order.pass.cpp test/atomics/atomics.syn/nothing_to_do.pass.cpp
Howard Hinnant
hhinnant at apple.com
Tue Sep 28 10:13:38 PDT 2010
Author: hhinnant
Date: Tue Sep 28 12:13:38 2010
New Revision: 114966
URL: http://llvm.org/viewvc/llvm-project?rev=114966&view=rev
Log:
[atomics.order]
Added:
libcxx/trunk/test/atomics/atomics.general/nothing_to_do.pass.cpp
libcxx/trunk/test/atomics/atomics.order/kill_dependency.pass.cpp
libcxx/trunk/test/atomics/atomics.order/memory_order.pass.cpp
libcxx/trunk/test/atomics/atomics.syn/nothing_to_do.pass.cpp
Modified:
libcxx/trunk/include/atomic
Modified: libcxx/trunk/include/atomic
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/atomic?rev=114966&r1=114965&r2=114966&view=diff
==============================================================================
--- libcxx/trunk/include/atomic (original)
+++ libcxx/trunk/include/atomic Tue Sep 28 12:13:38 2010
@@ -21,8 +21,12 @@
typedef enum memory_order
{
- memory_order_relaxed, memory_order_consume, memory_order_acquire,
- memory_order_release, memory_order_acq_rel, memory_order_seq_cst
+ memory_order_relaxed,
+ memory_order_consume, // load-consume
+ memory_order_acquire, // load-acquire
+ memory_order_release, // store-release
+ memory_order_acq_rel, // store-release load-acquire
+ memory_order_seq_cst // store-release load-acquire
} memory_order;
template <class T> T kill_dependency(T y);
@@ -2412,6 +2416,19 @@
_LIBCPP_BEGIN_NAMESPACE_STD
+typedef enum memory_order
+{
+ memory_order_relaxed, memory_order_consume, memory_order_acquire,
+ memory_order_release, memory_order_acq_rel, memory_order_seq_cst
+} memory_order;
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+_Tp
+kill_dependency(_Tp __y)
+{
+ return __y;
+}
_LIBCPP_END_NAMESPACE_STD
Added: libcxx/trunk/test/atomics/atomics.general/nothing_to_do.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/atomics/atomics.general/nothing_to_do.pass.cpp?rev=114966&view=auto
==============================================================================
--- libcxx/trunk/test/atomics/atomics.general/nothing_to_do.pass.cpp (added)
+++ libcxx/trunk/test/atomics/atomics.general/nothing_to_do.pass.cpp Tue Sep 28 12:13:38 2010
@@ -0,0 +1,13 @@
+// -*- C++ -*-
+//===-------------------------- algorithm ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
Added: libcxx/trunk/test/atomics/atomics.order/kill_dependency.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/atomics/atomics.order/kill_dependency.pass.cpp?rev=114966&view=auto
==============================================================================
--- libcxx/trunk/test/atomics/atomics.order/kill_dependency.pass.cpp (added)
+++ libcxx/trunk/test/atomics/atomics.order/kill_dependency.pass.cpp Tue Sep 28 12:13:38 2010
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <atomic>
+
+// template <class T> T kill_dependency(T y);
+
+#include <atomic>
+#include <cassert>
+
+int main()
+{
+ assert(std::kill_dependency(5) == 5);
+ assert(std::kill_dependency(-5.5) == -5.5);
+}
Added: libcxx/trunk/test/atomics/atomics.order/memory_order.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/atomics/atomics.order/memory_order.pass.cpp?rev=114966&view=auto
==============================================================================
--- libcxx/trunk/test/atomics/atomics.order/memory_order.pass.cpp (added)
+++ libcxx/trunk/test/atomics/atomics.order/memory_order.pass.cpp Tue Sep 28 12:13:38 2010
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <atomic>
+
+// typedef enum memory_order
+// {
+// memory_order_relaxed, memory_order_consume, memory_order_acquire,
+// memory_order_release, memory_order_acq_rel, memory_order_seq_cst
+// } memory_order;
+
+#include <atomic>
+#include <cassert>
+
+int main()
+{
+ assert(std::memory_order_relaxed == 0);
+ assert(std::memory_order_consume == 1);
+ assert(std::memory_order_acquire == 2);
+ assert(std::memory_order_release == 3);
+ assert(std::memory_order_acq_rel == 4);
+ assert(std::memory_order_seq_cst == 5);
+ std::memory_order o = std::memory_order_seq_cst;
+ assert(o == 5);
+}
Added: libcxx/trunk/test/atomics/atomics.syn/nothing_to_do.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/atomics/atomics.syn/nothing_to_do.pass.cpp?rev=114966&view=auto
==============================================================================
--- libcxx/trunk/test/atomics/atomics.syn/nothing_to_do.pass.cpp (added)
+++ libcxx/trunk/test/atomics/atomics.syn/nothing_to_do.pass.cpp Tue Sep 28 12:13:38 2010
@@ -0,0 +1,13 @@
+// -*- C++ -*-
+//===-------------------------- algorithm ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
More information about the cfe-commits
mailing list