Add test to ensure including <atomic> fails when _LIBCPP_HAS_NO_THREADS is defined.
authorEric Fiselier <eric@efcs.ca>
Mon, 27 Oct 2014 21:38:23 +0000 (21:38 +0000)
committerEric Fiselier <eric@efcs.ca>
Mon, 27 Oct 2014 21:38:23 +0000 (21:38 +0000)
llvm-svn: 220722

libcxx/test/atomics/libcpp-has-no-threads.fail.cpp [new file with mode: 0644]

diff --git a/libcxx/test/atomics/libcpp-has-no-threads.fail.cpp b/libcxx/test/atomics/libcpp-has-no-threads.fail.cpp
new file mode 100644 (file)
index 0000000..fe95e6a
--- /dev/null
@@ -0,0 +1,23 @@
+//===----------------------------------------------------------------------===//
+//
+//                     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.
+//
+//===----------------------------------------------------------------------===//
+
+// <atomic>
+
+// Test that including <atomic> fails to compile when _LIBCPP_HAS_NO_THREADS
+// is defined.
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+#define _LIBCPP_HAS_NO_THREADS
+#endif
+
+#include <atomic>
+
+int main()
+{
+}