Howard Hinnant | 748a527 | 2010-09-30 21:05:29 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Howard Hinnant | 412dbeb | 2010-11-16 22:09:02 +0000 | [diff] [blame] | 5 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | // Source Licenses. See LICENSE.TXT for details. |
Howard Hinnant | 748a527 | 2010-09-30 21:05:29 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
Jonathan Roelofs | b3fcc67 | 2014-09-05 19:45:05 +0000 | [diff] [blame] | 9 | // |
| 10 | // UNSUPPORTED: libcpp-has-no-threads |
Eric Fiselier | 749adeb | 2015-08-19 17:21:46 +0000 | [diff] [blame] | 11 | // XFAIL: c++98, c++03 |
Howard Hinnant | 748a527 | 2010-09-30 21:05:29 +0000 | [diff] [blame] | 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 | } |