summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/atomics
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2019-03-05 17:38:33 +0000
committerDavide Italiano <davide@freebsd.org>2019-03-05 17:38:33 +0000
commit1061cb6a93c2661905b5ee08718660f2bed243a3 (patch)
tree4af272f20ab8f111e9a8ddb90531ddb64b8da571 /libcxx/test/std/atomics
parent7421f7bd66ca24efe4440e1eabf75a5e21dcf439 (diff)
downloadbcm5719-llvm-1061cb6a93c2661905b5ee08718660f2bed243a3.tar.gz
bcm5719-llvm-1061cb6a93c2661905b5ee08718660f2bed243a3.zip
[libcxx] Revert set of atomic patches that broke lldb.
Revert "[libc++] Fix <atomic> failures on GCC" Revert "[libc++] Change memory_order to an enum class" Revert "[libc++] decoupling Freestanding atomic<T> from libatomic.a" The lldb formatter nededs to be updated. Shafik and Louis will coordinate to do so. llvm-svn: 355417
Diffstat (limited to 'libcxx/test/std/atomics')
-rw-r--r--libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp34
-rw-r--r--libcxx/test/std/atomics/atomics.order/memory_order.pass.cpp17
-rw-r--r--libcxx/test/std/atomics/atomics.order/memory_order_new.pass.cpp23
3 files changed, 25 insertions, 49 deletions
diff --git a/libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp b/libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
index 523f477cad4..d2ce1cefd28 100644
--- a/libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
@@ -39,8 +39,8 @@ template <bool Disable = NeedWorkaroundForPR31864,
class LLong = long long,
class ULLong = unsigned long long>
void checkLongLongTypes() {
- static_assert(std::atomic<LLong>::is_always_lock_free == (2 == ATOMIC_LLONG_LOCK_FREE), "");
- static_assert(std::atomic<ULLong>::is_always_lock_free == (2 == ATOMIC_LLONG_LOCK_FREE), "");
+ static_assert(std::atomic<LLong>::is_always_lock_free == (2 == ATOMIC_LLONG_LOCK_FREE));
+ static_assert(std::atomic<ULLong>::is_always_lock_free == (2 == ATOMIC_LLONG_LOCK_FREE));
}
// Used to make the calls to __atomic_always_lock_free dependent on a template
@@ -116,22 +116,22 @@ void run()
CHECK_ALWAYS_LOCK_FREE(union IntFloat { int i; float f; });
// C macro and static constexpr must be consistent.
- static_assert(std::atomic<bool>::is_always_lock_free == (2 == ATOMIC_BOOL_LOCK_FREE), "");
- static_assert(std::atomic<char>::is_always_lock_free == (2 == ATOMIC_CHAR_LOCK_FREE), "");
- static_assert(std::atomic<signed char>::is_always_lock_free == (2 == ATOMIC_CHAR_LOCK_FREE), "");
- static_assert(std::atomic<unsigned char>::is_always_lock_free == (2 == ATOMIC_CHAR_LOCK_FREE), "");
- static_assert(std::atomic<char16_t>::is_always_lock_free == (2 == ATOMIC_CHAR16_T_LOCK_FREE), "");
- static_assert(std::atomic<char32_t>::is_always_lock_free == (2 == ATOMIC_CHAR32_T_LOCK_FREE), "");
- static_assert(std::atomic<wchar_t>::is_always_lock_free == (2 == ATOMIC_WCHAR_T_LOCK_FREE), "");
- static_assert(std::atomic<short>::is_always_lock_free == (2 == ATOMIC_SHORT_LOCK_FREE), "");
- static_assert(std::atomic<unsigned short>::is_always_lock_free == (2 == ATOMIC_SHORT_LOCK_FREE), "");
- static_assert(std::atomic<int>::is_always_lock_free == (2 == ATOMIC_INT_LOCK_FREE), "");
- static_assert(std::atomic<unsigned int>::is_always_lock_free == (2 == ATOMIC_INT_LOCK_FREE), "");
- static_assert(std::atomic<long>::is_always_lock_free == (2 == ATOMIC_LONG_LOCK_FREE), "");
- static_assert(std::atomic<unsigned long>::is_always_lock_free == (2 == ATOMIC_LONG_LOCK_FREE), "");
+ static_assert(std::atomic<bool>::is_always_lock_free == (2 == ATOMIC_BOOL_LOCK_FREE));
+ static_assert(std::atomic<char>::is_always_lock_free == (2 == ATOMIC_CHAR_LOCK_FREE));
+ static_assert(std::atomic<signed char>::is_always_lock_free == (2 == ATOMIC_CHAR_LOCK_FREE));
+ static_assert(std::atomic<unsigned char>::is_always_lock_free == (2 == ATOMIC_CHAR_LOCK_FREE));
+ static_assert(std::atomic<char16_t>::is_always_lock_free == (2 == ATOMIC_CHAR16_T_LOCK_FREE));
+ static_assert(std::atomic<char32_t>::is_always_lock_free == (2 == ATOMIC_CHAR32_T_LOCK_FREE));
+ static_assert(std::atomic<wchar_t>::is_always_lock_free == (2 == ATOMIC_WCHAR_T_LOCK_FREE));
+ static_assert(std::atomic<short>::is_always_lock_free == (2 == ATOMIC_SHORT_LOCK_FREE));
+ static_assert(std::atomic<unsigned short>::is_always_lock_free == (2 == ATOMIC_SHORT_LOCK_FREE));
+ static_assert(std::atomic<int>::is_always_lock_free == (2 == ATOMIC_INT_LOCK_FREE));
+ static_assert(std::atomic<unsigned int>::is_always_lock_free == (2 == ATOMIC_INT_LOCK_FREE));
+ static_assert(std::atomic<long>::is_always_lock_free == (2 == ATOMIC_LONG_LOCK_FREE));
+ static_assert(std::atomic<unsigned long>::is_always_lock_free == (2 == ATOMIC_LONG_LOCK_FREE));
checkLongLongTypes();
- static_assert(std::atomic<void*>::is_always_lock_free == (2 == ATOMIC_POINTER_LOCK_FREE), "");
- static_assert(std::atomic<std::nullptr_t>::is_always_lock_free == (2 == ATOMIC_POINTER_LOCK_FREE), "");
+ static_assert(std::atomic<void*>::is_always_lock_free == (2 == ATOMIC_POINTER_LOCK_FREE));
+ static_assert(std::atomic<std::nullptr_t>::is_always_lock_free == (2 == ATOMIC_POINTER_LOCK_FREE));
}
int main(int, char**) { run(); return 0; }
diff --git a/libcxx/test/std/atomics/atomics.order/memory_order.pass.cpp b/libcxx/test/std/atomics/atomics.order/memory_order.pass.cpp
index c756d0b187b..973f58583ca 100644
--- a/libcxx/test/std/atomics/atomics.order/memory_order.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.order/memory_order.pass.cpp
@@ -21,15 +21,14 @@
int main(int, char**)
{
- assert(static_cast<int>(std::memory_order_relaxed) == 0);
- assert(static_cast<int>(std::memory_order_consume) == 1);
- assert(static_cast<int>(std::memory_order_acquire) == 2);
- assert(static_cast<int>(std::memory_order_release) == 3);
- assert(static_cast<int>(std::memory_order_acq_rel) == 4);
- assert(static_cast<int>(std::memory_order_seq_cst) == 5);
-
+ 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(static_cast<int>(o) == 5);
+ assert(o == 5);
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/atomics/atomics.order/memory_order_new.pass.cpp b/libcxx/test/std/atomics/atomics.order/memory_order_new.pass.cpp
deleted file mode 100644
index e9a571dfa8b..00000000000
--- a/libcxx/test/std/atomics/atomics.order/memory_order_new.pass.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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;
-}
OpenPOWER on IntegriCloud