//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads // // template // bool // atomic_is_lock_free(const volatile atomic* obj); // // template // bool // atomic_is_lock_free(const atomic* obj); #include #include #include "atomic_helpers.h" template struct TestFn { void operator()() const { typedef std::atomic A; A t; bool b1 = std::atomic_is_lock_free(static_cast(&t)); volatile A vt; bool b2 = std::atomic_is_lock_free(static_cast(&vt)); assert(b1 == b2); } }; struct A { char _[4]; }; int main() { TestFn()(); TestEachAtomicType()(); }