xref: /llvm-project/libcxx/test/std/atomics/atomics.flag/init.pass.cpp (revision 1544d1f9fdb115782202d72ad200c3f93b2c4f5a)
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // XFAIL: c++03
10 
11 // <atomic>
12 
13 // struct atomic_flag
14 
15 // atomic_flag() = ATOMIC_FLAG_INIT;
16 
17 #include <atomic>
18 #include <cassert>
19 
20 #include "test_macros.h"
21 
main(int,char **)22 int main(int, char**)
23 {
24     std::atomic_flag f = ATOMIC_FLAG_INIT;
25     assert(f.test_and_set() == 0);
26 
27   return 0;
28 }
29