Skip to content

Commit

Permalink
build: Fix false positive CHECK_ATOMIC test for clang-15
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Apr 12, 2024
1 parent 0de63b8 commit dd3e0fa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions build-aux/m4/l_atomic.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dnl warranty.
# Clang, when building for 32-bit,
# and linking against libstdc++, requires linking with
# -latomic if using the C++ atomic library.
# Can be tested with: clang++ test.cpp -m32
# Can be tested with: clang++ -std=c++20 test.cpp -m32
#
# Sourced from http://bugs.debian.org/797228

Expand All @@ -27,8 +27,11 @@ m4_define([_CHECK_ATOMIC_testbody], [[
auto t1 = t.load();
t.compare_exchange_strong(t1, 3s);
std::atomic<int64_t> a{};
std::atomic<double> d{};
d.store(3.14);
auto d1 = d.load();
std::atomic<int64_t> a{};
int64_t v = 5;
int64_t r = a.fetch_add(v);
return static_cast<int>(r);
Expand Down

0 comments on commit dd3e0fa

Please sign in to comment.