Skip to content

Commit af791c9

Browse files
committed
Hopefully fix test on x86
1 parent 271c27b commit af791c9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libcxx/test/support/atomic_helpers.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,12 @@ static_assert(LockFreeStatusInfo<char>::status_known, "");
9191
static_assert(LockFreeStatusInfo<short>::status_known, "");
9292
static_assert(LockFreeStatusInfo<int>::status_known, "");
9393
static_assert(LockFreeStatusInfo<long>::status_known, "");
94-
static_assert(LockFreeStatusInfo<long long>::status_known, "");
9594
static_assert(LockFreeStatusInfo<void*>::status_known, "");
9695

96+
// long long is a bit funky: on some platforms, its alignment is 4 bytes but its size is
97+
// 8 bytes. In that case, atomics may or may not be lockfree based on their address.
98+
static_assert(alignof(long long) == sizeof(long long) ? LockFreeStatusInfo<long long>::status_known : true, "");
99+
97100
// Those should always be lock free: hardcode some expected values to make sure our tests are actually
98101
// testing something meaningful.
99102
static_assert(LockFreeStatusInfo<char>::value == LockFreeStatus::always, "");

0 commit comments

Comments
 (0)