blob: c4a121b094a404580e50dae69829bed1105e2b59 [file] [log] [blame]
Howard Hinnant748a5272010-09-30 21:05:29 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
Howard Hinnant412dbeb2010-11-16 22:09:02 +00005// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
Howard Hinnant748a5272010-09-30 21:05:29 +00007//
8//===----------------------------------------------------------------------===//
Jonathan Roelofsb3fcc672014-09-05 19:45:05 +00009//
10// UNSUPPORTED: libcpp-has-no-threads
Eric Fiselier749adeb2015-08-19 17:21:46 +000011// XFAIL: c++98, c++03
Howard Hinnant748a5272010-09-30 21:05:29 +000012
13// <atomic>
14
15// struct atomic_flag
16
17// atomic_flag() = ATOMIC_FLAG_INIT;
18
19#include <atomic>
20#include <cassert>
21
22int main()
23{
24 std::atomic_flag f = ATOMIC_FLAG_INIT;
25 assert(f.test_and_set() == 0);
26}