Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -84,7 +84,7 @@ option(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS "Build libc++ with support for thread-unsafe C functions" ON) option(LIBCXX_ENABLE_MONOTONIC_CLOCK "Build libc++ with support for a monotonic clock. - This option may only be used when LIBCXX_ENABLE_THREADS=OFF." ON) + This option may only be set to OFF when LIBCXX_ENABLE_THREADS=OFF." ON) # Misc options ---------------------------------------------------------------- option(LIBCXX_ENABLE_PEDANTIC "Compile with pedantic enabled." ON) @@ -247,7 +247,7 @@ define_if_not(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS -D_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS) -# Sanitizer flags +# Sanitizer flags ============================================================= # Configure for sanitizers. If LIBCXX_BUILT_STANDALONE then we have to do # the flag translation ourselves. Othewise LLVM's CMakeList.txt will handle it. Index: test/libcxx/atomics/libcpp-has-no-threads.fail.cpp =================================================================== --- test/libcxx/atomics/libcpp-has-no-threads.fail.cpp +++ test/libcxx/atomics/libcpp-has-no-threads.fail.cpp @@ -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. +// +//===----------------------------------------------------------------------===// + +// + +// Test that including fails to compile when _LIBCPP_HAS_NO_THREADS +// is defined. + +#ifndef _LIBCPP_HAS_NO_THREADS +#define _LIBCPP_HAS_NO_THREADS +#endif + +#include + +int main() +{ +} Index: test/libcxx/atomics/libcpp-has-no-threads.pass.cpp =================================================================== --- test/libcxx/atomics/libcpp-has-no-threads.pass.cpp +++ test/libcxx/atomics/libcpp-has-no-threads.pass.cpp @@ -0,0 +1,18 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// +// XFAIL: libcpp-has-no-threads + +#ifdef _LIBCPP_HAS_NO_THREADS +#error This should be XFAIL'd for the purpose of detecting that the LIT feature\ + 'libcpp-has-no-threads' is available iff _LIBCPP_HAS_NO_THREADS is defined +#endif + +int main() +{ +} Index: test/std/atomics/libcpp-has-no-threads.fail.cpp =================================================================== --- test/std/atomics/libcpp-has-no-threads.fail.cpp +++ test/std/atomics/libcpp-has-no-threads.fail.cpp @@ -1,23 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// - -// Test that including fails to compile when _LIBCPP_HAS_NO_THREADS -// is defined. - -#ifndef _LIBCPP_HAS_NO_THREADS -#define _LIBCPP_HAS_NO_THREADS -#endif - -#include - -int main() -{ -} Index: test/std/atomics/libcpp-has-no-threads.pass.cpp =================================================================== --- test/std/atomics/libcpp-has-no-threads.pass.cpp +++ test/std/atomics/libcpp-has-no-threads.pass.cpp @@ -1,18 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// -// XFAIL: libcpp-has-no-threads - -#ifdef _LIBCPP_HAS_NO_THREADS -#error This should be XFAIL'd for the purpose of detecting that the LIT feature\ - 'libcpp-has-no-threads' is available iff _LIBCPP_HAS_NO_THREADS is defined -#endif - -int main() -{ -} Index: test/std/utilities/date.time/tested_elsewhere.pass.cpp =================================================================== --- test/std/utilities/date.time/tested_elsewhere.pass.cpp +++ test/std/utilities/date.time/tested_elsewhere.pass.cpp @@ -30,9 +30,11 @@ static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); +#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); +#endif static_assert((std::is_same::value), ""); }