// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include #include TEST("verify lock freeness of atomics"){ { std::atomic uint32V; ASSERT_TRUE(uint32V.is_lock_free()); } { std::atomic uint64V; ASSERT_TRUE(uint64V.is_lock_free()); } { std::atomic taggedPtr; ASSERT_EQUAL(16u, sizeof(vespamalloc::TaggedPtr)); // See https://gcc.gnu.org/ml/gcc-patches/2017-01/msg02344.html for background ASSERT_TRUE(taggedPtr.is_lock_free() || !taggedPtr.is_lock_free()); } } TEST_MAIN() { TEST_RUN_ALL(); }