Skip to content

Commit fec28de

Browse files
committed
Check for atomic<double> intrinsics
On some architectures e.g. x86/32bit gcc decides to inline calls to double atomic variables but clang does not and defers it to libatomic therefore detect if clang can use built-ins for atomic<double> if not then link libatomic, this helps building clangd for x86 on linux systems with gcc runtime Upstream-Status: Pending Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 parent eefb9d4 commit fec28de

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/cmake/modules/CheckAtomic.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ function(check_working_cxx_atomics64 varname)
3030
#include <atomic>
3131
#include <cstdint>
3232
std::atomic<uint64_t> x (0);
33+
std::atomic<double> y (0);
3334
int main() {
3435
uint64_t i = x.load(std::memory_order_relaxed);
3536
(void)i;
36-
return 0;
37+
return int(y);
3738
}
3839
" ${varname})
3940
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})

0 commit comments

Comments
 (0)