summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/atomics/atomics.flag/init.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/std/atomics/atomics.flag/init.pass.cpp')
-rw-r--r--libcxx/test/std/atomics/atomics.flag/init.pass.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/libcxx/test/std/atomics/atomics.flag/init.pass.cpp b/libcxx/test/std/atomics/atomics.flag/init.pass.cpp
new file mode 100644
index 00000000000..c90509d8fbb
--- /dev/null
+++ b/libcxx/test/std/atomics/atomics.flag/init.pass.cpp
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+
+// <atomic>
+
+// struct atomic_flag
+
+// atomic_flag() = ATOMIC_FLAG_INIT;
+
+#include <atomic>
+#include <cassert>
+
+int main()
+{
+ std::atomic_flag f = ATOMIC_FLAG_INIT;
+ assert(f.test_and_set() == 0);
+}
OpenPOWER on IntegriCloud