1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // UNSUPPORTED: libcpp-has-no-threads 11 // XFAIL: c++98, c++03 12 13 // <atomic> 14 15 // struct atomic_flag 16 17 // atomic_flag() = ATOMIC_FLAG_INIT; 18 19 #include <atomic> 20 #include <cassert> 21 22 int main() 23 { 24 std::atomic_flag f = ATOMIC_FLAG_INIT; 25 assert(f.test_and_set() == 0); 26 } 27