[libcxx-commits] [PATCH] D119246: [libcxx][AIX][PowerPC] Disable workaround for PR31864 on powerpc
Kai Luo via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Feb 8 18:08:25 PST 2022
lkail updated this revision to Diff 407022.
lkail added a comment.
Removed the workaround and trigger libcxx-ci.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119246/new/
https://reviews.llvm.org/D119246
Files:
libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
Index: libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
===================================================================
--- libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
+++ libcxx/test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
@@ -8,9 +8,6 @@
//
// UNSUPPORTED: c++03, c++11, c++14
-// Fails for 32-bit builds.
-// UNSUPPORTED: LIBCXX-AIX-FIXME
-
// <atomic>
// static constexpr bool is_always_lock_free;
@@ -29,38 +26,9 @@
assert(std::atomic<T>().is_lock_free());
}
-// FIXME: This separate test is needed to work around llvm.org/PR31864
-// which causes ATOMIC_LLONG_LOCK_FREE to be defined as '1' in 32-bit builds
-// even though __atomic_always_lock_free returns true for the same type.
-constexpr bool NeedWorkaroundForPR31864 =
-#if defined(__clang__)
-(sizeof(void*) == 4); // Needed on 32 bit builds
-#else
-false;
-#endif
-
-template <bool Disable = NeedWorkaroundForPR31864,
- std::enable_if_t<!Disable>* = nullptr,
- 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), "");
-}
-
-// Used to make the calls to __atomic_always_lock_free dependent on a template
-// parameter.
-template <class T> constexpr size_t getSizeOf() { return sizeof(T); }
-
-template <bool Enable = NeedWorkaroundForPR31864,
- std::enable_if_t<Enable>* = nullptr,
- class LLong = long long,
- class ULLong = unsigned long long>
void checkLongLongTypes() {
- constexpr bool ExpectLockFree = __atomic_always_lock_free(getSizeOf<LLong>(), 0);
- static_assert(std::atomic<LLong>::is_always_lock_free == ExpectLockFree, "");
- static_assert(std::atomic<ULLong>::is_always_lock_free == ExpectLockFree, "");
- static_assert((0 != ATOMIC_LLONG_LOCK_FREE) == ExpectLockFree, "");
+ static_assert(std::atomic<long long>::is_always_lock_free == (2 == ATOMIC_LLONG_LOCK_FREE), "");
+ static_assert(std::atomic<unsigned long long>::is_always_lock_free == (2 == ATOMIC_LLONG_LOCK_FREE), "");
}
void run()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119246.407022.patch
Type: text/x-patch
Size: 2192 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220209/376639b6/attachment-0001.bin>
More information about the libcxx-commits
mailing list