aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-04-26 19:24:31 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-04-26 19:24:31 +0000
commit2fa809d9eabddd820af54059faa8362dd50b51de (patch)
treed24999651df3a7a5d330d20573335db9a8afcc89
parent1c3313bd0215c89fb38710a1ea0762ccf32e859c (diff)
downloadsrc-2fa809d9eabddd820af54059faa8362dd50b51de.tar.gz
src-2fa809d9eabddd820af54059faa8362dd50b51de.zip
Notes
Notes: svn path=/vendor/libc++/dist/; revision=317451 svn path=/vendor/libc++/libc++-trunk-r302069/; revision=317766; tag=vendor/libc++/libc++-trunk-r302069
-rw-r--r--CMakeLists.txt20
-rw-r--r--include/atomic33
-rw-r--r--include/math.h89
-rw-r--r--include/mutex2
-rw-r--r--test/libcxx/atomics/diagnose_invalid_memory_order.fail.cpp4
-rw-r--r--test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp6
-rw-r--r--test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp3
-rw-r--r--test/libcxx/modules/cinttypes_exports.sh.cpp4
-rw-r--r--test/libcxx/modules/clocale_exports.sh.cpp4
-rw-r--r--test/libcxx/modules/cstdint_exports.sh.cpp4
-rw-r--r--test/libcxx/modules/inttypes_h_exports.sh.cpp4
-rw-r--r--test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp3
-rw-r--r--test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp4
-rw-r--r--test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp4
-rw-r--r--test/libcxx/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp4
-rw-r--r--test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.fail.cpp4
-rw-r--r--test/libcxx/thread/thread.mutex/thread_safety_requires_capability.pass.cpp4
-rw-r--r--test/std/language.support/support.exception/except.nested/assign.pass.cpp3
-rw-r--r--test/std/language.support/support.exception/except.nested/ctor_copy.pass.cpp3
-rw-r--r--test/std/language.support/support.exception/except.nested/ctor_default.pass.cpp3
-rw-r--r--test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp5
-rw-r--r--test/std/language.support/support.exception/except.nested/rethrow_nested.pass.cpp3
-rw-r--r--test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp3
-rw-r--r--test/std/language.support/support.exception/propagation/current_exception.pass.cpp3
-rw-r--r--test/std/language.support/support.exception/propagation/exception_ptr.pass.cpp3
-rw-r--r--test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp3
-rw-r--r--test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp3
-rw-r--r--test/std/numerics/c.math/cmath.pass.cpp33
-rw-r--r--test/std/strings/basic.string/string.cons/T_size_size.pass.cpp1
-rw-r--r--test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp26
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp4
-rw-r--r--test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp18
-rw-r--r--utils/libcxx/test/config.py6
33 files changed, 262 insertions, 54 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d3bd533396b6..ef1726b78d9c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -120,21 +120,19 @@ if (LIBCXX_CXX_ABI STREQUAL "default")
${LLVM_MAIN_SRC_DIR}/runtimes/libcxxabi/include
NO_DEFAULT_PATH
)
- if ((NOT LIBCXX_STANDALONE_BUILD OR HAVE_LIBCXXABI) AND
- IS_DIRECTORY "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
+ if (LIBCXX_TARGETING_MSVC)
+ # FIXME: Figure out how to configure the ABI library on Windows.
+ set(LIBCXX_CXX_ABI_LIBNAME "vcruntime")
+ elseif ((NOT LIBCXX_STANDALONE_BUILD OR HAVE_LIBCXXABI) AND
+ IS_DIRECTORY "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
set(LIBCXX_CXX_ABI_INTREE 1)
+ elseif (APPLE)
+ set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
+ set(LIBCXX_CXX_ABI_SYSTEM 1)
else()
- if (LIBCXX_TARGETING_MSVC)
- # FIXME: Figure out how to configure the ABI library on Windows.
- set(LIBCXX_CXX_ABI_LIBNAME "vcruntime")
- elseif(APPLE)
- set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
- set(LIBCXX_CXX_ABI_SYSTEM 1)
- else()
- set(LIBCXX_CXX_ABI_LIBNAME "default")
- endif()
+ set(LIBCXX_CXX_ABI_LIBNAME "default")
endif()
else()
set(LIBCXX_CXX_ABI_LIBNAME "${LIBCXX_CXX_ABI}")
diff --git a/include/atomic b/include/atomic
index a17bdce1cc6f..f55e28ff5e92 100644
--- a/include/atomic
+++ b/include/atomic
@@ -861,16 +861,29 @@ kill_dependency(_Tp __y) _NOEXCEPT
return __y;
}
-#define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE
-#define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE
-#define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE
-#define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE
-#define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE
-#define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE
-#define ATOMIC_INT_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE
-#define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE
-#define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE
-#define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE
+#if defined(__CLANG_ATOMIC_BOOL_LOCK_FREE)
+# define ATOMIC_BOOL_LOCK_FREE __CLANG_ATOMIC_BOOL_LOCK_FREE
+# define ATOMIC_CHAR_LOCK_FREE __CLANG_ATOMIC_CHAR_LOCK_FREE
+# define ATOMIC_CHAR16_T_LOCK_FREE __CLANG_ATOMIC_CHAR16_T_LOCK_FREE
+# define ATOMIC_CHAR32_T_LOCK_FREE __CLANG_ATOMIC_CHAR32_T_LOCK_FREE
+# define ATOMIC_WCHAR_T_LOCK_FREE __CLANG_ATOMIC_WCHAR_T_LOCK_FREE
+# define ATOMIC_SHORT_LOCK_FREE __CLANG_ATOMIC_SHORT_LOCK_FREE
+# define ATOMIC_INT_LOCK_FREE __CLANG_ATOMIC_INT_LOCK_FREE
+# define ATOMIC_LONG_LOCK_FREE __CLANG_ATOMIC_LONG_LOCK_FREE
+# define ATOMIC_LLONG_LOCK_FREE __CLANG_ATOMIC_LLONG_LOCK_FREE
+# define ATOMIC_POINTER_LOCK_FREE __CLANG_ATOMIC_POINTER_LOCK_FREE
+#else
+# define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE
+# define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE
+# define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE
+# define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE
+# define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE
+# define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE
+# define ATOMIC_INT_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE
+# define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE
+# define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE
+# define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE
+#endif
// general atomic<T>
diff --git a/include/math.h b/include/math.h
index 79ebf2f119d7..8c30ba85d22c 100644
--- a/include/math.h
+++ b/include/math.h
@@ -307,6 +307,7 @@ long double truncl(long double x);
extern "C++" {
#include <type_traits>
+#include <limits>
// signbit
@@ -324,22 +325,50 @@ __libcpp_signbit(_A1 __lcpp_x) _NOEXCEPT
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
+typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
signbit(_A1 __lcpp_x) _NOEXCEPT
{
return __libcpp_signbit((typename std::__promote<_A1>::type)__lcpp_x);
}
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<
+ std::is_integral<_A1>::value && std::is_signed<_A1>::value, bool>::type
+signbit(_A1 __lcpp_x) _NOEXCEPT
+{ return __lcpp_x < 0; }
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<
+ std::is_integral<_A1>::value && !std::is_signed<_A1>::value, bool>::type
+signbit(_A1) _NOEXCEPT
+{ return false; }
+
#elif defined(_LIBCPP_MSVCRT)
template <typename _A1>
inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
+typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
signbit(_A1 __lcpp_x) _NOEXCEPT
{
return ::signbit(static_cast<typename std::__promote<_A1>::type>(__lcpp_x));
}
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<
+ std::is_integral<_A1>::value && std::is_signed<_A1>::value, bool>::type
+signbit(_A1 __lcpp_x) _NOEXCEPT
+{ return __lcpp_x < 0; }
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<
+ std::is_integral<_A1>::value && !std::is_signed<_A1>::value, bool>::type
+signbit(_A1) _NOEXCEPT
+{ return false; }
+
#endif // signbit
// fpclassify
@@ -358,22 +387,34 @@ __libcpp_fpclassify(_A1 __lcpp_x) _NOEXCEPT
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_arithmetic<_A1>::value, int>::type
+typename std::enable_if<std::is_floating_point<_A1>::value, int>::type
fpclassify(_A1 __lcpp_x) _NOEXCEPT
{
return __libcpp_fpclassify((typename std::__promote<_A1>::type)__lcpp_x);
}
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, int>::type
+fpclassify(_A1 __lcpp_x) _NOEXCEPT
+{ return __lcpp_x == 0 ? FP_ZERO : FP_NORMAL; }
+
#elif defined(_LIBCPP_MSVCRT)
template <typename _A1>
inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_arithmetic<_A1>::value, int>::type
+typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
fpclassify(_A1 __lcpp_x) _NOEXCEPT
{
return ::fpclassify(static_cast<typename std::__promote<_A1>::type>(__lcpp_x));
}
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, int>::type
+fpclassify(_A1 __lcpp_x) _NOEXCEPT
+{ return __lcpp_x == 0 ? FP_ZERO : FP_NORMAL; }
+
#endif // fpclassify
// isfinite
@@ -392,12 +433,22 @@ __libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
+typename std::enable_if<
+ std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity,
+ bool>::type
isfinite(_A1 __lcpp_x) _NOEXCEPT
{
return __libcpp_isfinite((typename std::__promote<_A1>::type)__lcpp_x);
}
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<
+ std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity,
+ bool>::type
+isfinite(_A1) _NOEXCEPT
+{ return true; }
+
#endif // isfinite
// isinf
@@ -416,12 +467,22 @@ __libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
+typename std::enable_if<
+ std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity,
+ bool>::type
isinf(_A1 __lcpp_x) _NOEXCEPT
{
return __libcpp_isinf((typename std::__promote<_A1>::type)__lcpp_x);
}
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<
+ std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity,
+ bool>::type
+isinf(_A1) _NOEXCEPT
+{ return false; }
+
#endif // isinf
// isnan
@@ -440,12 +501,18 @@ __libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
+typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
isnan(_A1 __lcpp_x) _NOEXCEPT
{
return __libcpp_isnan((typename std::__promote<_A1>::type)__lcpp_x);
}
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, bool>::type
+isnan(_A1) _NOEXCEPT
+{ return false; }
+
#endif // isnan
// isnormal
@@ -464,12 +531,18 @@ __libcpp_isnormal(_A1 __lcpp_x) _NOEXCEPT
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
+typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
isnormal(_A1 __lcpp_x) _NOEXCEPT
{
return __libcpp_isnormal((typename std::__promote<_A1>::type)__lcpp_x);
}
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, bool>::type
+isnormal(_A1 __lcpp_x) _NOEXCEPT
+{ return __lcpp_x != 0; }
+
#endif // isnormal
// isgreater
diff --git a/include/mutex b/include/mutex
index e92baa51ae75..0b25614e8ead 100644
--- a/include/mutex
+++ b/include/mutex
@@ -685,7 +685,7 @@ inline _LIBCPP_INLINE_VISIBILITY
void
call_once(once_flag& __flag, const _Callable& __func)
{
- if (__flag.__state_ != ~0ul)
+ if (__libcpp_acquire_load(&__flag.__state_) != ~0ul)
{
__call_once_param<const _Callable> __p(__func);
__call_once(__flag.__state_, &__p, &__call_once_proxy<const _Callable>);
diff --git a/test/libcxx/atomics/diagnose_invalid_memory_order.fail.cpp b/test/libcxx/atomics/diagnose_invalid_memory_order.fail.cpp
index d8bb363d86b0..51a1f2307ac6 100644
--- a/test/libcxx/atomics/diagnose_invalid_memory_order.fail.cpp
+++ b/test/libcxx/atomics/diagnose_invalid_memory_order.fail.cpp
@@ -7,6 +7,10 @@
//
//===----------------------------------------------------------------------===//
+// This test fails because diagnose_if doesn't emit all of the diagnostics
+// when -fdelayed-template-parsing is enabled, like it is on Windows.
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// REQUIRES: verify-support, diagnose-if-support
// UNSUPPORTED: libcpp-has-no-threads
diff --git a/test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp b/test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp
index 04b40009cda9..8c17aabd640a 100644
--- a/test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp
+++ b/test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp
@@ -10,6 +10,10 @@
// test libc++'s implementation of align_val_t, and the relevent new/delete
// overloads in all dialects when -faligned-allocation is present.
+// Libc++ defers to the underlying MSVC library to provide the new/delete
+// definitions, which does not yet provide aligned allocation
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// REQUIRES: -faligned-allocation
// RUN: %build -faligned-allocation
@@ -74,4 +78,4 @@ int main() {
assert(typeid(std::align_val_t).name() == std::string("St11align_val_t"));
}
#endif
-} \ No newline at end of file
+}
diff --git a/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp b/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
index 9ba422fc0c9e..18cc0ca97166 100644
--- a/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
+++ b/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// 'do_bytes' throws a std::range_error unexpectedly
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// UNSUPPORTED: c++98, c++03
// <locale>
diff --git a/test/libcxx/modules/cinttypes_exports.sh.cpp b/test/libcxx/modules/cinttypes_exports.sh.cpp
index 99d20ec65027..ce39ceea44d9 100644
--- a/test/libcxx/modules/cinttypes_exports.sh.cpp
+++ b/test/libcxx/modules/cinttypes_exports.sh.cpp
@@ -7,6 +7,10 @@
//
//===----------------------------------------------------------------------===//
+// This test fails on Windows because the underlying libc headers on Windows
+// are not modular
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// REQUIRES: modules-support
// Test that <cinttypes> re-exports <cstdint>
diff --git a/test/libcxx/modules/clocale_exports.sh.cpp b/test/libcxx/modules/clocale_exports.sh.cpp
index 69b1a9bd6624..aacddd2d857e 100644
--- a/test/libcxx/modules/clocale_exports.sh.cpp
+++ b/test/libcxx/modules/clocale_exports.sh.cpp
@@ -7,6 +7,10 @@
//
//===----------------------------------------------------------------------===//
+// This test fails on Windows because the underlying libc headers on Windows
+// are not modular
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// REQUIRES: modules-support
// UNSUPPORTED: c++98, c++03
diff --git a/test/libcxx/modules/cstdint_exports.sh.cpp b/test/libcxx/modules/cstdint_exports.sh.cpp
index 8ecc1da28f1a..3d3cbe338174 100644
--- a/test/libcxx/modules/cstdint_exports.sh.cpp
+++ b/test/libcxx/modules/cstdint_exports.sh.cpp
@@ -7,6 +7,10 @@
//
//===----------------------------------------------------------------------===//
+// This test fails on Windows because the underlying libc headers on Windows
+// are not modular
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// REQUIRES: modules-support
// Test that <cstdint> re-exports <stdint.h>
diff --git a/test/libcxx/modules/inttypes_h_exports.sh.cpp b/test/libcxx/modules/inttypes_h_exports.sh.cpp
index d1598d7eab3f..5354c8fef338 100644
--- a/test/libcxx/modules/inttypes_h_exports.sh.cpp
+++ b/test/libcxx/modules/inttypes_h_exports.sh.cpp
@@ -7,6 +7,10 @@
//
//===----------------------------------------------------------------------===//
+// This test fails on Windows because the underlying libc headers on Windows
+// are not modular
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// REQUIRES: modules-support
// Test that intypes.h re-exports stdint.h
diff --git a/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp b/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp
index bf567a30243a..12c0a3d5ef41 100644
--- a/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp
+++ b/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp
@@ -8,6 +8,9 @@
//===----------------------------------------------------------------------===//
//
+// This test depends on std::exception_ptr which has not yet been implemented.
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// UNSUPPORTED: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
diff --git a/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp b/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp
index 1cb61d9af297..713f4716c764 100644
--- a/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp
+++ b/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp
@@ -6,7 +6,9 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-//
+
+// This test depends on std::exception_ptr which has not yet been implemented.
+// XFAIL: LIBCXX-WINDOWS-FIXME
// UNSUPPORTED: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
diff --git a/test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp b/test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp
index bff682ec4e00..6024d9978433 100644
--- a/test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp
+++ b/test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp
@@ -7,6 +7,10 @@
//
//===----------------------------------------------------------------------===//
+// On Windows Clang bugs out when both __declspec and __attribute__ are present,
+// the processing goes awry preventing the definition of the types.
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// UNSUPPORTED: libcpp-has-no-threads
// REQUIRES: thread-safety
diff --git a/test/libcxx/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp b/test/libcxx/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp
index 3898d08d8378..3ada120cb9dc 100644
--- a/test/libcxx/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp
+++ b/test/libcxx/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp
@@ -7,6 +7,10 @@
//
//===----------------------------------------------------------------------===//
+// On Windows Clang bugs out when both __declspec and __attribute__ are present,
+// the processing goes awry preventing the definition of the types.
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// UNSUPPORTED: libcpp-has-no-threads
// REQUIRES: thread-safety
diff --git a/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.fail.cpp b/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.fail.cpp
index 941e9ff8f678..cf3e63847905 100644
--- a/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.fail.cpp
+++ b/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.fail.cpp
@@ -7,6 +7,10 @@
//
//===----------------------------------------------------------------------===//
+// On Windows Clang bugs out when both __declspec and __attribute__ are present,
+// the processing goes awry preventing the definition of the types.
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// UNSUPPORTED: libcpp-has-no-threads
// REQUIRES: thread-safety
diff --git a/test/libcxx/thread/thread.mutex/thread_safety_requires_capability.pass.cpp b/test/libcxx/thread/thread.mutex/thread_safety_requires_capability.pass.cpp
index 1a5685e8deb8..e0681048d308 100644
--- a/test/libcxx/thread/thread.mutex/thread_safety_requires_capability.pass.cpp
+++ b/test/libcxx/thread/thread.mutex/thread_safety_requires_capability.pass.cpp
@@ -7,6 +7,10 @@
//
//===----------------------------------------------------------------------===//
+// On Windows Clang bugs out when both __declspec and __attribute__ are present,
+// the processing goes awry preventing the definition of the types.
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// UNSUPPORTED: libcpp-has-no-threads
// REQUIRES: thread-safety
diff --git a/test/std/language.support/support.exception/except.nested/assign.pass.cpp b/test/std/language.support/support.exception/except.nested/assign.pass.cpp
index 6338c8aaa26e..ec5575d072ce 100644
--- a/test/std/language.support/support.exception/except.nested/assign.pass.cpp
+++ b/test/std/language.support/support.exception/except.nested/assign.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// exception_ptr has not been implemented on Windows
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// <exception>
// class nested_exception;
diff --git a/test/std/language.support/support.exception/except.nested/ctor_copy.pass.cpp b/test/std/language.support/support.exception/except.nested/ctor_copy.pass.cpp
index 4cbdbb2ec892..92134c993af3 100644
--- a/test/std/language.support/support.exception/except.nested/ctor_copy.pass.cpp
+++ b/test/std/language.support/support.exception/except.nested/ctor_copy.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// exception_ptr has not been implemented on Windows
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// <exception>
// class nested_exception;
diff --git a/test/std/language.support/support.exception/except.nested/ctor_default.pass.cpp b/test/std/language.support/support.exception/except.nested/ctor_default.pass.cpp
index 18ca9968ff56..8f8503b254d3 100644
--- a/test/std/language.support/support.exception/except.nested/ctor_default.pass.cpp
+++ b/test/std/language.support/support.exception/except.nested/ctor_default.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// exception_ptr has not been implemented on Windows
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// <exception>
// class nested_exception;
diff --git a/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp b/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
index 68cd85038b28..fe9cd6042ba8 100644
--- a/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
+++ b/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// exception_ptr has not been implemented on Windows
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// UNSUPPORTED: libcpp-no-exceptions
// <exception>
@@ -43,7 +46,7 @@ class C
{
public:
virtual ~C() {}
- C * operator&() const { assert(false); } // should not be called
+ C * operator&() const { assert(false); return nullptr; } // should not be called
};
class D : private std::nested_exception {};
diff --git a/test/std/language.support/support.exception/except.nested/rethrow_nested.pass.cpp b/test/std/language.support/support.exception/except.nested/rethrow_nested.pass.cpp
index d511a72f9f57..73d02da39333 100644
--- a/test/std/language.support/support.exception/except.nested/rethrow_nested.pass.cpp
+++ b/test/std/language.support/support.exception/except.nested/rethrow_nested.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// exception_ptr has not been implemented on Windows
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// UNSUPPORTED: libcpp-no-exceptions
// <exception>
diff --git a/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp b/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp
index 6a9f25cd0855..6353afcb239b 100644
--- a/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp
+++ b/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// exception_ptr has not been implemented on Windows
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// UNSUPPORTED: libcpp-no-exceptions
// <exception>
diff --git a/test/std/language.support/support.exception/propagation/current_exception.pass.cpp b/test/std/language.support/support.exception/propagation/current_exception.pass.cpp
index 661f789fefd7..2046997774a8 100644
--- a/test/std/language.support/support.exception/propagation/current_exception.pass.cpp
+++ b/test/std/language.support/support.exception/propagation/current_exception.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// exception_ptr has not been implemented on Windows
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// UNSUPPORTED: libcpp-no-exceptions
// <exception>
diff --git a/test/std/language.support/support.exception/propagation/exception_ptr.pass.cpp b/test/std/language.support/support.exception/propagation/exception_ptr.pass.cpp
index 3aa8dcf55bbc..9621a7360364 100644
--- a/test/std/language.support/support.exception/propagation/exception_ptr.pass.cpp
+++ b/test/std/language.support/support.exception/propagation/exception_ptr.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// exception_ptr has not been implemented on Windows
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// <exception>
// typedef unspecified exception_ptr;
diff --git a/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp b/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
index 36feda7304bc..4980c656b2b5 100644
--- a/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
+++ b/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// exception_ptr has not been implemented on Windows
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// UNSUPPORTED: libcpp-no-exceptions
// <exception>
diff --git a/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp b/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp
index 565166cbdf76..7d27eee6689a 100644
--- a/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp
+++ b/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// exception_ptr has not been implemented on Windows
+// XFAIL: LIBCXX-WINDOWS-FIXME
+
// UNSUPPORTED: libcpp-no-exceptions
// <exception>
diff --git a/test/std/numerics/c.math/cmath.pass.cpp b/test/std/numerics/c.math/cmath.pass.cpp
index 7161bd37e3e2..b5f586492bde 100644
--- a/test/std/numerics/c.math/cmath.pass.cpp
+++ b/test/std/numerics/c.math/cmath.pass.cpp
@@ -10,6 +10,7 @@
// <cmath>
#include <cmath>
+#include <limits>
#include <type_traits>
#include <cassert>
@@ -551,6 +552,13 @@ void test_signbit()
static_assert((std::is_same<decltype(std::signbit((long double)0)), bool>::value), "");
static_assert((std::is_same<decltype(signbit(Ambiguous())), Ambiguous>::value), "");
assert(std::signbit(-1.0) == true);
+ assert(std::signbit(0u) == false);
+ assert(std::signbit(std::numeric_limits<unsigned>::max()) == false);
+ assert(std::signbit(0) == false);
+ assert(std::signbit(1) == false);
+ assert(std::signbit(-1) == true);
+ assert(std::signbit(std::numeric_limits<int>::max()) == false);
+ assert(std::signbit(std::numeric_limits<int>::min()) == true);
}
void test_fpclassify()
@@ -564,6 +572,11 @@ void test_fpclassify()
static_assert((std::is_same<decltype(std::fpclassify((long double)0)), int>::value), "");
static_assert((std::is_same<decltype(fpclassify(Ambiguous())), Ambiguous>::value), "");
assert(std::fpclassify(-1.0) == FP_NORMAL);
+ assert(std::fpclassify(0) == FP_ZERO);
+ assert(std::fpclassify(1) == FP_NORMAL);
+ assert(std::fpclassify(-1) == FP_NORMAL);
+ assert(std::fpclassify(std::numeric_limits<int>::max()) == FP_NORMAL);
+ assert(std::fpclassify(std::numeric_limits<int>::min()) == FP_NORMAL);
}
void test_isfinite()
@@ -577,6 +590,11 @@ void test_isfinite()
static_assert((std::is_same<decltype(std::isfinite((long double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isfinite(Ambiguous())), Ambiguous>::value), "");
assert(std::isfinite(-1.0) == true);
+ assert(std::isfinite(0) == true);
+ assert(std::isfinite(1) == true);
+ assert(std::isfinite(-1) == true);
+ assert(std::isfinite(std::numeric_limits<int>::max()) == true);
+ assert(std::isfinite(std::numeric_limits<int>::min()) == true);
}
void test_isnormal()
@@ -590,6 +608,11 @@ void test_isnormal()
static_assert((std::is_same<decltype(std::isnormal((long double)0)), bool>::value), "");
static_assert((std::is_same<decltype(isnormal(Ambiguous())), Ambiguous>::value), "");
assert(std::isnormal(-1.0) == true);
+ assert(std::isnormal(0) == false);
+ assert(std::isnormal(1) == true);
+ assert(std::isnormal(-1) == true);
+ assert(std::isnormal(std::numeric_limits<int>::max()) == true);
+ assert(std::isnormal(std::numeric_limits<int>::min()) == true);
}
void test_isgreater()
@@ -651,6 +674,11 @@ void test_isinf()
static_assert((std::is_same<decltype(std::isinf(0)), bool>::value), "");
static_assert((std::is_same<decltype(std::isinf((long double)0)), bool>::value), "");
assert(std::isinf(-1.0) == false);
+ assert(std::isinf(0) == false);
+ assert(std::isinf(1) == false);
+ assert(std::isinf(-1) == false);
+ assert(std::isinf(std::numeric_limits<int>::max()) == false);
+ assert(std::isinf(std::numeric_limits<int>::min()) == false);
}
void test_isless()
@@ -731,6 +759,11 @@ void test_isnan()
static_assert((std::is_same<decltype(std::isnan(0)), bool>::value), "");
static_assert((std::is_same<decltype(std::isnan((long double)0)), bool>::value), "");
assert(std::isnan(-1.0) == false);
+ assert(std::isnan(0) == false);
+ assert(std::isnan(1) == false);
+ assert(std::isnan(-1) == false);
+ assert(std::isnan(std::numeric_limits<int>::max()) == false);
+ assert(std::isnan(std::numeric_limits<int>::min()) == false);
}
void test_isunordered()
diff --git a/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp b/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp
index 312e4d27fef1..c8d14a1d0ddf 100644
--- a/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp
+++ b/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp
@@ -63,7 +63,6 @@ void
test(SV sv, unsigned pos, unsigned n, const typename S::allocator_type& a)
{
typedef typename S::traits_type T;
- typedef typename S::allocator_type A;
if (pos <= sv.size())
{
S s2(sv, pos, n, a);
diff --git a/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp b/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp
index 75dfb0a2e704..7ed6121e5301 100644
--- a/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp
+++ b/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp
@@ -44,7 +44,7 @@ void test_emplace_type() {
auto &v = a.emplace<Type>();
static_assert( std::is_same_v<Type&, decltype(v)>, "" );
- assert(&v == std::any_cast<Type>(&a));
+ assert(&v == std::any_cast<Type>(&a));
assert(Tracked::count == 0);
assert(Type::count == 1);
@@ -60,7 +60,7 @@ void test_emplace_type() {
auto &v = a.emplace<Type>(101);
static_assert( std::is_same_v<Type&, decltype(v)>, "" );
- assert(&v == std::any_cast<Type>(&a));
+ assert(&v == std::any_cast<Type>(&a));
assert(Tracked::count == 0);
assert(Type::count == 1);
@@ -76,7 +76,7 @@ void test_emplace_type() {
auto &v = a.emplace<Type>(-1, 42, -1);
static_assert( std::is_same_v<Type&, decltype(v)>, "" );
- assert(&v == std::any_cast<Type>(&a));
+ assert(&v == std::any_cast<Type>(&a));
assert(Tracked::count == 0);
assert(Type::count == 1);
@@ -97,7 +97,7 @@ void test_emplace_type_tracked() {
assert(Tracked::count == 1);
auto &v = a.emplace<Type>();
static_assert( std::is_same_v<Type&, decltype(v)>, "" );
- assert(&v == std::any_cast<Type>(&a));
+ assert(&v == std::any_cast<Type>(&a));
assert(Tracked::count == 0);
assertArgsMatch<Type>(a);
@@ -107,7 +107,7 @@ void test_emplace_type_tracked() {
assert(Tracked::count == 1);
auto &v = a.emplace<Type>(-1, 42, -1);
static_assert( std::is_same_v<Type&, decltype(v)>, "" );
- assert(&v == std::any_cast<Type>(&a));
+ assert(&v == std::any_cast<Type>(&a));
assert(Tracked::count == 0);
assertArgsMatch<Type, int, int, int>(a);
@@ -118,7 +118,7 @@ void test_emplace_type_tracked() {
assert(Tracked::count == 1);
auto &v = a.emplace<Type>({-1, 42, -1});
static_assert( std::is_same_v<Type&, decltype(v)>, "" );
- assert(&v == std::any_cast<Type>(&a));
+ assert(&v == std::any_cast<Type>(&a));
assert(Tracked::count == 0);
assertArgsMatch<Type, std::initializer_list<int>>(a);
@@ -129,7 +129,7 @@ void test_emplace_type_tracked() {
assert(Tracked::count == 1);
auto &v = a.emplace<Type>({-1, 42, -1}, x);
static_assert( std::is_same_v<Type&, decltype(v)>, "" );
- assert(&v == std::any_cast<Type>(&a));
+ assert(&v == std::any_cast<Type>(&a));
assert(Tracked::count == 0);
assertArgsMatch<Type, std::initializer_list<int>, int&>(a);
@@ -159,7 +159,8 @@ void test_emplace_throws()
std::any a(small{42});
assert(small::count == 1);
try {
- a.emplace<Type>(101);
+ auto &v = a.emplace<Type>(101);
+ static_assert( std::is_same_v<Type&, decltype(v)>, "" );
assert(false);
} catch (int const&) {
}
@@ -169,7 +170,8 @@ void test_emplace_throws()
std::any a(small{42});
assert(small::count == 1);
try {
- a.emplace<Type>({1, 2, 3}, 101);
+ auto &v = a.emplace<Type>({1, 2, 3}, 101);
+ static_assert( std::is_same_v<Type&, decltype(v)>, "" );
assert(false);
} catch (int const&) {
}
@@ -180,7 +182,8 @@ void test_emplace_throws()
std::any a(large{42});
assert(large::count == 1);
try {
- a.emplace<Type>(101);
+ auto &v = a.emplace<Type>(101);
+ static_assert( std::is_same_v<Type&, decltype(v)>, "" );
assert(false);
} catch (int const&) {
}
@@ -190,7 +193,8 @@ void test_emplace_throws()
std::any a(large{42});
assert(large::count == 1);
try {
- a.emplace<Type>({1, 2, 3}, 101);
+ auto &v = a.emplace<Type>({1, 2, 3}, 101);
+ static_assert( std::is_same_v<Type&, decltype(v)>, "" );
assert(false);
} catch (int const&) {
}
diff --git a/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp
index 0696c11526d5..e7f59f1a94ca 100644
--- a/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp
+++ b/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp
@@ -254,7 +254,9 @@ int main()
{
assert(static_cast<bool>(opt) == true);
assert(Y::dtor_called == false);
- opt.emplace(1);
+ auto &v = opt.emplace(1);
+ static_assert( std::is_same_v<Y&, decltype(v)>, "" );
+ assert(false);
}
catch (int i)
{
diff --git a/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
index 1c3c69a70303..f6959c7e9cfd 100644
--- a/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
+++ b/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
@@ -11,7 +11,7 @@
// <optional>
// template <class U, class... Args>
-// void optional<T>::emplace(initializer_list<U> il, Args&&... args);
+// T& optional<T>::emplace(initializer_list<U> il, Args&&... args);
#include <optional>
#include <type_traits>
@@ -76,21 +76,27 @@ int main()
X x;
optional<X> opt(x);
assert(X::dtor_called == false);
- opt.emplace({1, 2});
+ auto &v = opt.emplace({1, 2});
+ static_assert( std::is_same_v<X&, decltype(v)>, "" );
assert(X::dtor_called == true);
assert(*opt == X({1, 2}));
+ assert(&v == &*opt);
}
{
optional<std::vector<int>> opt;
- opt.emplace({1, 2, 3}, std::allocator<int>());
+ auto &v = opt.emplace({1, 2, 3}, std::allocator<int>());
+ static_assert( std::is_same_v<std::vector<int>&, decltype(v)>, "" );
assert(static_cast<bool>(opt) == true);
assert(*opt == std::vector<int>({1, 2, 3}));
+ assert(&v == &*opt);
}
{
optional<Y> opt;
- opt.emplace({1, 2});
+ auto &v = opt.emplace({1, 2});
+ static_assert( std::is_same_v<Y&, decltype(v)>, "" );
assert(static_cast<bool>(opt) == true);
assert(*opt == Y({1, 2}));
+ assert(&v == &*opt);
}
#ifndef TEST_HAS_NO_EXCEPTIONS
{
@@ -100,7 +106,9 @@ int main()
{
assert(static_cast<bool>(opt) == true);
assert(Z::dtor_called == false);
- opt.emplace({1, 2});
+ auto &v = opt.emplace({1, 2});
+ static_assert( std::is_same_v<Z&, decltype(v)>, "" );
+ assert(false);
}
catch (int i)
{
diff --git a/utils/libcxx/test/config.py b/utils/libcxx/test/config.py
index bd99e8ddd978..f839a3a0985e 100644
--- a/utils/libcxx/test/config.py
+++ b/utils/libcxx/test/config.py
@@ -311,10 +311,10 @@ class Configuration(object):
# NOTE: We do not test for the -verify flag directly because
# -verify will always exit with non-zero on an empty file.
self.use_clang_verify = self.cxx.isVerifySupported()
- if self.use_clang_verify:
- self.config.available_features.add('verify-support')
self.lit_config.note(
"inferred use_clang_verify as: %r" % self.use_clang_verify)
+ if self.use_clang_verify:
+ self.config.available_features.add('verify-support')
def configure_use_thread_safety(self):
'''If set, run clang with -verify on failing tests.'''
@@ -418,7 +418,7 @@ class Configuration(object):
# initial Windows failures until they can be properly diagnosed
# and fixed. This allows easier detection of new test failures
# and regressions. Note: New failures should not be suppressed
- # using this feature.
+ # using this feature. (Also see llvm.org/PR32730)
self.config.available_features.add('LIBCXX-WINDOWS-FIXME')
# Attempt to detect the glibc version by querying for __GLIBC__