The 32-bit version of LLVM failed on my computer with linker errors
saying that the __atomic_{load,store} symbols were undefined. See
https://gentz.rocks/files/1570147715/llvm_link_fail for full error log.
The 32-bit version of libatomic.so exposes no __atomic_*_8, unlike the
64-bit version of the library. Instead, 32-bit programs that want to use
non power of two atomics or atomics that are greater than 32-bits need the
__atomic_* functions.
Previously, the 32-bit LLVM builds would successfully compile the file
defined in check_working_cxx_atomics64 and think they don't need to
link in libatomic.so.
The reason for this is unknown to me. std::atomic<uint64_t> compiles
yet std::atomic<double> does not. Anyways, I've modified the tests to
test for both.
We also remove some code dupe between the 32-bit and 64-bit versions.
We also also unify the 64-bit version in CheckAtomic.cmake with the code in
CheckLibcxxAtomic.cmake. It appears that when CheckLibcxxAtomic.cmake was
made, CheckAtomic.cmake did not have a 64-bit version, but that is no longer
the case, so I see no reason not to merge them.