summaryrefslogtreecommitdiffstats
path: root/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp
diff options
context:
space:
mode:
authorDan Austin <danielaustin@google.com>2016-06-08 22:25:43 +0000
committerDan Austin <danielaustin@google.com>2016-06-08 22:25:43 +0000
commitee226c05af9e0187098f43fb71465a581487af9b (patch)
tree780cae976165d7708c7ece6e72d1eb81650c5ac8 /test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp
parent1d4a1edbc7e4461b59239e1b8297e9dd395a6322 (diff)
downloadexternal_libcxx-ee226c05af9e0187098f43fb71465a581487af9b.tar.gz
external_libcxx-ee226c05af9e0187098f43fb71465a581487af9b.tar.bz2
external_libcxx-ee226c05af9e0187098f43fb71465a581487af9b.zip
Revert "Revert "Update aosp/master libcxx rebase to r263688""
This reverts commit 1d4a1edbc7e4461b59239e1b8297e9dd395a6322. Change-Id: I2909937fe582f2c5552bc86e7f4d2d5cff0de0aa
Diffstat (limited to 'test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp')
-rw-r--r--test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp41
1 files changed, 7 insertions, 34 deletions
diff --git a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp
index 9977bd491..2dc90c9ac 100644
--- a/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp
+++ b/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.pass.cpp
@@ -32,10 +32,11 @@
#include <type_traits>
#include <cassert>
+#include "atomic_helpers.h"
+
template <class T>
-void
-test()
-{
+struct TestFn {
+ void operator()() const {
{
typedef std::atomic<T> A;
A t;
@@ -52,7 +53,8 @@ test()
std::memory_order_seq_cst) == T(1));
assert(t == T(3));
}
-}
+ }
+};
template <class T>
void
@@ -78,38 +80,9 @@ testp()
}
}
-struct A
-{
- int i;
-
- explicit A(int d = 0) noexcept {i=d;}
- A(const A& a) : i(a.i) {}
- A(const volatile A& a) : i(a.i) {}
-
- void operator=(const volatile A& a) volatile {i = a.i;}
-
- friend bool operator==(const A& x, const A& y)
- {return x.i == y.i;}
-};
-
int main()
{
- test<char>();
- test<signed char>();
- test<unsigned char>();
- test<short>();
- test<unsigned short>();
- test<int>();
- test<unsigned int>();
- test<long>();
- test<unsigned long>();
- test<long long>();
- test<unsigned long long>();
- test<wchar_t>();
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
- test<char16_t>();
- test<char32_t>();
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+ TestEachIntegralType<TestFn>()();
testp<int*>();
testp<const int*>();
}