diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -68,11 +68,11 @@ ${ENABLE_FILESYSTEM_DEFAULT}) option(LIBCXX_INCLUDE_TESTS "Build the libc++ tests." ${LLVM_INCLUDE_TESTS}) option(LIBCXX_ENABLE_PARALLEL_ALGORITHMS "Enable the parallel algorithms library. This requires the PSTL to be available." OFF) -option(LIBCXX_ENABLE_DEBUG_MODE_SUPPORT - "Whether to include support for libc++'s debugging mode in the library. - By default, this is turned on. If you turn it off and try to enable the - debug mode when compiling a program against libc++, it will fail to link - since the required support isn't provided in the library." ON) +option(LIBCXX_ENABLE_DEBUG_MODE + "Whether to build libc++ with the debug mode enabled. + By default, this is turned off. Turning it on results in a different ABI (additional + symbols but also potentially different layouts of types), and one should not mix code + built against a dylib that has debug mode and code built against a regular dylib." OFF) option(LIBCXX_ENABLE_RANDOM_DEVICE "Whether to include support for std::random_device in the library. Disabling this can be useful when building the library for platforms that don't have @@ -210,6 +210,13 @@ option(LIBCXX_EXTRA_SITE_DEFINES "Extra defines to add into __config_site") option(LIBCXX_USE_COMPILER_RT "Use compiler-rt instead of libgcc" OFF) +cmake_dependent_option(LIBCXX_ENABLE_BACKWARDS_COMPATIBILITY_DEBUG_MODE_SYMBOLS + "Whether to include the old Debug mode symbols in the compiled library. This + is provided for backwards compatibility since the compiled library used to + always contain those symbols, regardless of whether the library was built + with the debug mode enabled." ON + "LIBCXX_ABI_VERSION EQUAL 1" OFF) # Always OFF in ABI version != 1 + # ABI Library options --------------------------------------------------------- if (LIBCXX_TARGETING_MSVC) set(LIBCXX_DEFAULT_ABI_LIBRARY "vcruntime") @@ -854,6 +861,7 @@ config_define_if_not(LIBCXX_ENABLE_UNICODE _LIBCPP_HAS_NO_UNICODE) config_define_if_not(LIBCXX_ENABLE_WIDE_CHARACTERS _LIBCPP_HAS_NO_WIDE_CHARACTERS) config_define_if_not(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS) +config_define_if(LIBCXX_ENABLE_DEBUG_MODE _LIBCPP_ENABLE_DEBUG_MODE) if (LIBCXX_ENABLE_ASSERTIONS) config_define(1 _LIBCPP_ENABLE_ASSERTIONS_DEFAULT) else() diff --git a/libcxx/cmake/caches/Apple.cmake b/libcxx/cmake/caches/Apple.cmake --- a/libcxx/cmake/caches/Apple.cmake +++ b/libcxx/cmake/caches/Apple.cmake @@ -9,7 +9,7 @@ set(LIBCXX_ENABLE_SHARED ON CACHE BOOL "") set(LIBCXX_CXX_ABI libcxxabi CACHE STRING "") set(LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT ON CACHE BOOL "") -set(LIBCXX_ENABLE_DEBUG_MODE_SUPPORT OFF CACHE BOOL "") +set(LIBCXX_ENABLE_BACKWARDS_COMPATIBILITY_DEBUG_MODE_SYMBOLS OFF CACHE BOOL "") set(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS ON CACHE BOOL "") set(LIBCXX_ENABLE_INCOMPLETE_FEATURES OFF CACHE BOOL "") diff --git a/libcxx/cmake/caches/Generic-debug-iterators.cmake b/libcxx/cmake/caches/Generic-debug-iterators.cmake deleted file mode 100644 --- a/libcxx/cmake/caches/Generic-debug-iterators.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set(LIBCXX_TEST_PARAMS "debug_level=1" CACHE STRING "") -set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "") diff --git a/libcxx/cmake/caches/Generic-debug-mode.cmake b/libcxx/cmake/caches/Generic-debug-mode.cmake new file mode 100644 --- /dev/null +++ b/libcxx/cmake/caches/Generic-debug-mode.cmake @@ -0,0 +1 @@ +set(LIBCXX_ENABLE_DEBUG_MODE ON CACHE BOOL "") diff --git a/libcxx/cmake/caches/Generic-no-debug.cmake b/libcxx/cmake/caches/Generic-no-debug.cmake deleted file mode 100644 --- a/libcxx/cmake/caches/Generic-no-debug.cmake +++ /dev/null @@ -1 +0,0 @@ -set(LIBCXX_ENABLE_DEBUG_MODE_SUPPORT OFF CACHE BOOL "") diff --git a/libcxx/docs/DesignDocs/DebugMode.rst b/libcxx/docs/DesignDocs/DebugMode.rst --- a/libcxx/docs/DesignDocs/DebugMode.rst +++ b/libcxx/docs/DesignDocs/DebugMode.rst @@ -12,35 +12,33 @@ Libc++ provides a debug mode that enables special debugging checks meant to detect incorrect usage of the standard library. These checks are disabled by default, but -they can be enabled using the ``_LIBCPP_DEBUG`` macro. +they can be enabled by vendors when building the library by using ``LIBCXX_ENABLE_DEBUG_MODE``. -Note that using the debug mode discussed in this document requires that the library -has been compiled with support for the debug mode (see ``LIBCXX_ENABLE_DEBUG_MODE_SUPPORT``). +Since the debug mode has ABI implications, users should compile their whole program, +including any dependent libraries, against a Standard library configured identically +with respect to the debug mode. In other words, they should not mix code built against +a Standard library with the debug mode enabled with code built against a Standard library +where the debug mode is disabled. -Also note that while the debug mode has no effect on libc++'s ABI, it does have broad ODR -implications. Users should compile their whole program at the same debugging level. +Furthermore, users should not rely on a stable ABI being provided when the debug mode is +enabled -- we reserve the right to change the ABI at any time. If you need a stable ABI +and still want some level of hardening, you should look into enabling :ref:`assertions ` +instead. -The various levels of checking provided by the debug mode follow. +The debug mode provides various checks to aid application debugging. -No debugging checks (``_LIBCPP_DEBUG`` not defined) ---------------------------------------------------- -When ``_LIBCPP_DEBUG`` is not defined, there are no debugging checks performed by -the library. This is the default. - -Comparator consistency checks (``_LIBCPP_DEBUG == 1``) ------------------------------------------------------- +Comparator consistency checks +----------------------------- Libc++ provides some checks for the consistency of comparators passed to algorithms. Specifically, many algorithms such as ``binary_search``, ``merge``, ``next_permutation``, and ``sort``, wrap the user-provided comparator to assert that `!comp(y, x)` whenever `comp(x, y)`. This can cause the user-provided comparator to be evaluated up to twice as many times as it would be without the debug mode, and causes the library to violate some of the Standard's complexity clauses. -Iterator debugging checks (``_LIBCPP_DEBUG == 1``) --------------------------------------------------- -Defining ``_LIBCPP_DEBUG`` to ``1`` enables "iterator debugging", which provides -additional assertions about the validity of iterators used by the program. - -The following containers and classes support iterator debugging: +Iterator debugging checks +------------------------- +The library contains various assertions to check the validity of iterators used +by the program. The following containers and classes support iterator debugging: - ``std::string`` - ``std::vector`` (``T != bool``) @@ -53,34 +51,11 @@ The remaining containers do not currently support iterator debugging. Patches welcome. -Randomizing Unspecified Behavior (``_LIBCPP_DEBUG == 1``) ---------------------------------------------------------- -This also enables the randomization of unspecified behavior, for -example, for equal elements in ``std::sort`` or randomizing both parts of -the partition after ``std::nth_element`` call. This effort helps you to migrate -to potential future faster versions of these algorithms and deflake your tests -which depend on such behavior. To fix the seed, use -``_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY_SEED=seed`` definition. - -Handling Assertion Failures -=========================== -When a debug assertion fails the assertion handler is called via the -``std::__libcpp_debug_function`` function pointer. It is possible to override -this function pointer using a different handler function. Libc++ provides a -the default handler, ``std::__libcpp_abort_debug_handler``, which aborts the -program. The handler may not return. Libc++ can be changed to use a custom -assertion handler as follows. - -.. code-block:: cpp - - #define _LIBCPP_DEBUG 1 - #include - void my_handler(std::__libcpp_debug_info const&); - int main(int, char**) { - std::__libcpp_debug_function = &my_handler; - - std::string::iterator bad_it; - std::string str("hello world"); - str.insert(bad_it, '!'); // causes debug assertion - // control flow doesn't return - } +Randomizing unspecified behavior +-------------------------------- +The library supports the randomization of unspecified behavior. For example, randomizing +the relative order of equal elements in ``std::sort`` or randomizing both parts of the +partition after calling ``std::nth_element``. This effort helps migrating to potential +future faster versions of these algorithms that might not have the exact same behavior. +In particular, it makes it easier to deflake tests that depend on unspecified behavior. +A seed can be used to make such failures reproducible: use ``_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY_SEED=seed``. diff --git a/libcxx/docs/ReleaseNotes.rst b/libcxx/docs/ReleaseNotes.rst --- a/libcxx/docs/ReleaseNotes.rst +++ b/libcxx/docs/ReleaseNotes.rst @@ -113,6 +113,13 @@ - ``vector::const_reference``, ``vector::const_iterator::reference`` and ``bitset::const_reference`` are now aliases for `bool` in the unstable ABI. +- The ``_LIBCPP_DEBUG`` macro is not supported anymore. It will be honoured until + LLVM 16, and then it will be an error to define that macro. To enable basic + assertions (previously ``_LIBCPP_DEBUG=0``), please use ``_LIBCPP_ENABLE_ASSERTIONS=1``. + To enable the debug mode (previously ``_LIBCPP_DEBUG=1|2``), please ensure that + the library has been built with support for the debug mode, and it will be + enabled automatically (no need to define ``_LIBCPP_DEBUG``). + ABI Changes ----------- @@ -168,3 +175,7 @@ configuration and isn't supported by one of the configurations in ``libcxx/test/configs``, ``libcxxabi/test/configs`` or ``libunwind/test/configs``, please move to one of those configurations or define your own. + +- The ``LIBCXX_ENABLE_DEBUG_MODE_SUPPORT`` CMake configuration is not supported anymore. If you + were disabling support for the debug mode with that flag, please use ``LIBCXX_ENABLE_BACKWARDS_COMPATIBILITY_DEBUG_MODE_SYMBOLS=OFF`` + instead. diff --git a/libcxx/docs/TestingLibcxx.rst b/libcxx/docs/TestingLibcxx.rst --- a/libcxx/docs/TestingLibcxx.rst +++ b/libcxx/docs/TestingLibcxx.rst @@ -158,13 +158,6 @@ still be used to specify the path of the library to link to and run against, respectively. -.. option:: debug_level= - - **Values**: 0, 1 - - Enable the use of debug mode. Level 0 enables assertions and level 1 enables - assertions and debugging of iterator misuse. - .. option:: use_sanitizer= **Values**: Memory, MemoryWithOrigins, Address, Undefined diff --git a/libcxx/docs/UsingLibcxx.rst b/libcxx/docs/UsingLibcxx.rst --- a/libcxx/docs/UsingLibcxx.rst +++ b/libcxx/docs/UsingLibcxx.rst @@ -214,9 +214,6 @@ or disable extended libc++ behavior, including enabling "debug mode" or thread safety annotations. -**_LIBCPP_DEBUG**: - See :ref:`using-debug-mode` for more information. - **_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS**: This macro is used to enable -Wthread-safety annotations on libc++'s ``std::mutex`` and ``std::lock_guard``. By default, these annotations are diff --git a/libcxx/include/__algorithm/comp_ref_type.h b/libcxx/include/__algorithm/comp_ref_type.h --- a/libcxx/include/__algorithm/comp_ref_type.h +++ b/libcxx/include/__algorithm/comp_ref_type.h @@ -68,7 +68,7 @@ struct __comp_ref_type { // Pass the comparator by lvalue reference. Or in debug mode, using a // debugging wrapper that stores a reference. -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE typedef __debug_less<_Comp> type; #else typedef _Comp& type; diff --git a/libcxx/include/__algorithm/nth_element.h b/libcxx/include/__algorithm/nth_element.h --- a/libcxx/include/__algorithm/nth_element.h +++ b/libcxx/include/__algorithm/nth_element.h @@ -13,6 +13,7 @@ #include <__algorithm/comp_ref_type.h> #include <__algorithm/sort.h> #include <__config> +#include <__debug> #include <__iterator/iterator_traits.h> #include <__utility/swap.h> diff --git a/libcxx/include/__algorithm/partial_sort.h b/libcxx/include/__algorithm/partial_sort.h --- a/libcxx/include/__algorithm/partial_sort.h +++ b/libcxx/include/__algorithm/partial_sort.h @@ -15,6 +15,7 @@ #include <__algorithm/sift_down.h> #include <__algorithm/sort_heap.h> #include <__config> +#include <__debug> #include <__iterator/iterator_traits.h> #include <__utility/swap.h> diff --git a/libcxx/include/__algorithm/shuffle.h b/libcxx/include/__algorithm/shuffle.h --- a/libcxx/include/__algorithm/shuffle.h +++ b/libcxx/include/__algorithm/shuffle.h @@ -10,6 +10,7 @@ #define _LIBCPP___ALGORITHM_SHUFFLE_H #include <__config> +#include <__debug> #include <__iterator/iterator_traits.h> #include <__random/uniform_int_distribution.h> #include <__utility/swap.h> diff --git a/libcxx/include/__algorithm/sort.h b/libcxx/include/__algorithm/sort.h --- a/libcxx/include/__algorithm/sort.h +++ b/libcxx/include/__algorithm/sort.h @@ -16,6 +16,7 @@ #include <__algorithm/unwrap_iter.h> #include <__bits> #include <__config> +#include <__debug> #include <__functional/operations.h> #include <__utility/swap.h> #include diff --git a/libcxx/include/__algorithm/unwrap_iter.h b/libcxx/include/__algorithm/unwrap_iter.h --- a/libcxx/include/__algorithm/unwrap_iter.h +++ b/libcxx/include/__algorithm/unwrap_iter.h @@ -43,7 +43,7 @@ } }; -#if _LIBCPP_DEBUG_LEVEL < 2 +#ifndef _LIBCPP_ENABLE_DEBUG_MODE template struct __unwrap_iter_impl<_Iter, true> { @@ -53,7 +53,7 @@ } }; -#endif // _LIBCPP_DEBUG_LEVEL < 2 +#endif // !_LIBCPP_ENABLE_DEBUG_MODE template > inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR diff --git a/libcxx/include/__assert b/libcxx/include/__assert --- a/libcxx/include/__assert +++ b/libcxx/include/__assert @@ -19,7 +19,15 @@ // This is for backwards compatibility with code that might have been enabling // assertions through the Debug mode previously. -#if _LIBCPP_DEBUG_LEVEL >= 1 +// TODO: In LLVM 16, make it an error to define _LIBCPP_DEBUG +#if defined(_LIBCPP_DEBUG) +# ifndef _LIBCPP_ENABLE_ASSERTIONS +# define _LIBCPP_ENABLE_ASSERTIONS 1 +# endif +#endif + +// Automatically enable assertions when the debug mode is enabled. +#if defined(_LIBCPP_ENABLE_DEBUG_MODE) # ifndef _LIBCPP_ENABLE_ASSERTIONS # define _LIBCPP_ENABLE_ASSERTIONS 1 # endif diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -792,55 +792,14 @@ # define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) #endif // _LIBCPP_CXX03_LANG -// _LIBCPP_DEBUG potential values: -// - undefined: No assertions. This is the default. -// - 0: Basic assertions -// - 1: Basic assertions + iterator validity checks + unspecified behavior randomization. -# if !defined(_LIBCPP_DEBUG) -# define _LIBCPP_DEBUG_LEVEL 0 -# elif _LIBCPP_DEBUG == 0 -# define _LIBCPP_DEBUG_LEVEL 1 -# elif _LIBCPP_DEBUG == 1 -# define _LIBCPP_DEBUG_LEVEL 2 -# else -# error Supported values for _LIBCPP_DEBUG are 0 and 1 -# endif - -# if _LIBCPP_DEBUG_LEVEL >= 2 && !defined(_LIBCPP_CXX03_LANG) -# define _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY -# endif - -# if defined(_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY) -# if defined(_LIBCPP_CXX03_LANG) -# error Support for unspecified stability is only for C++11 and higher -# endif -# define _LIBCPP_DEBUG_RANDOMIZE_RANGE(__first, __last) \ - do { \ - if (!__builtin_is_constant_evaluated()) \ - _VSTD::shuffle(__first, __last, __libcpp_debug_randomizer()); \ - } while (false) -# else -# define _LIBCPP_DEBUG_RANDOMIZE_RANGE(__first, __last) \ - do { \ - } while (false) -# endif - // Libc++ allows disabling extern template instantiation declarations by // means of users defining _LIBCPP_DISABLE_EXTERN_TEMPLATE. // -// Furthermore, when the Debug mode is enabled, we disable extern declarations -// when building user code because we don't want to use the functions compiled -// in the library, which might not have had the debug mode enabled when built. -// However, some extern declarations need to be used, because code correctness -// depends on it (several instances in ). Those special declarations -// are declared with _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE, which is enabled -// even when the debug mode is enabled. +// TODO: Remove _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE, which is not needed +// since the Debug mode is a configuration-time property. #if defined(_LIBCPP_DISABLE_EXTERN_TEMPLATE) # define _LIBCPP_EXTERN_TEMPLATE(...) /* nothing */ # define _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(...) /* nothing */ -#elif _LIBCPP_DEBUG_LEVEL >= 1 && !defined(_LIBCPP_BUILDING_LIBRARY) -# define _LIBCPP_EXTERN_TEMPLATE(...) /* nothing */ -# define _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(...) extern template __VA_ARGS__; #else # define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__; # define _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(...) extern template __VA_ARGS__; diff --git a/libcxx/include/__config_site.in b/libcxx/include/__config_site.in --- a/libcxx/include/__config_site.in +++ b/libcxx/include/__config_site.in @@ -33,6 +33,7 @@ #cmakedefine _LIBCPP_HAS_NO_INCOMPLETE_FORMAT #cmakedefine _LIBCPP_HAS_NO_INCOMPLETE_RANGES #cmakedefine01 _LIBCPP_ENABLE_ASSERTIONS_DEFAULT +#cmakedefine _LIBCPP_ENABLE_DEBUG_MODE // __USE_MINGW_ANSI_STDIO gets redefined on MinGW #ifdef __clang__ diff --git a/libcxx/include/__debug b/libcxx/include/__debug --- a/libcxx/include/__debug +++ b/libcxx/include/__debug @@ -18,23 +18,44 @@ # pragma GCC system_header #endif -#if _LIBCPP_DEBUG_LEVEL >= 1 || defined(_LIBCPP_BUILDING_LIBRARY) -# include -# include -# include +// Catch invalid uses of the legacy _LIBCPP_DEBUG toggle. +#if defined(_LIBCPP_DEBUG) && _LIBCPP_DEBUG != 0 && !defined(_LIBCPP_ENABLE_DEBUG_MODE) +# error "Enabling the debug mode now requires having configured the library with support for the debug mode" #endif -#if _LIBCPP_DEBUG_LEVEL == 0 || _LIBCPP_DEBUG_LEVEL == 1 -# define _LIBCPP_DEBUG_ASSERT(x, m) ((void)0) -#elif _LIBCPP_DEBUG_LEVEL == 2 +#if defined(_LIBCPP_ENABLE_DEBUG_MODE) && !defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY) +# define _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY +#endif + +// TODO: Define this as a function instead +#if defined(_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY) +# if defined(_LIBCPP_CXX03_LANG) +# error Support for unspecified stability is only for C++11 and higher +# endif +# define _LIBCPP_DEBUG_RANDOMIZE_RANGE(__first, __last) \ + do { \ + if (!__builtin_is_constant_evaluated()) \ + std::shuffle(__first, __last, __libcpp_debug_randomizer()); \ + } while (false) +#else +# define _LIBCPP_DEBUG_RANDOMIZE_RANGE(__first, __last) \ + do { \ + } while (false) +#endif + +#ifdef _LIBCPP_ENABLE_DEBUG_MODE # define _LIBCPP_DEBUG_ASSERT(x, m) _LIBCPP_ASSERT(::std::__libcpp_is_constant_evaluated() || (x), m) #else -# error _LIBCPP_DEBUG_LEVEL must be one of 0, 1, 2 +# define _LIBCPP_DEBUG_ASSERT(x, m) ((void)0) #endif -_LIBCPP_BEGIN_NAMESPACE_STD +#if defined(_LIBCPP_ENABLE_DEBUG_MODE) || defined(_LIBCPP_BUILDING_LIBRARY) + +#include +#include +#include -#if _LIBCPP_DEBUG_LEVEL == 2 || defined(_LIBCPP_BUILDING_LIBRARY) +_LIBCPP_BEGIN_NAMESPACE_STD struct _LIBCPP_TYPE_VIS __c_node; @@ -203,12 +224,15 @@ _LIBCPP_FUNC_VIS __libcpp_db* __get_db(); _LIBCPP_FUNC_VIS const __libcpp_db* __get_const_db(); +_LIBCPP_END_NAMESPACE_STD + +#endif // defined(_LIBCPP_ENABLE_DEBUG_MODE) || defined(_LIBCPP_BUILDING_LIBRARY) -#endif // _LIBCPP_DEBUG_LEVEL == 2 || defined(_LIBCPP_BUILDING_LIBRARY) +_LIBCPP_BEGIN_NAMESPACE_STD template _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 inline void __debug_db_insert_c(_Tp* __c) { -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE if (!__libcpp_is_constant_evaluated()) __get_db()->__insert_c(__c); #else @@ -218,7 +242,7 @@ template _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 inline void __debug_db_insert_i(_Tp* __i) { -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE if (!__libcpp_is_constant_evaluated()) __get_db()->__insert_i(__i); #else @@ -228,7 +252,7 @@ template _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 inline void __debug_db_erase_c(_Tp* __c) { -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE if (!__libcpp_is_constant_evaluated()) __get_db()->__erase_c(__c); #else @@ -238,7 +262,7 @@ template _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 inline void __debug_db_swap(_Tp* __lhs, _Tp* __rhs) { -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE if (!__libcpp_is_constant_evaluated()) __get_db()->swap(__lhs, __rhs); #else @@ -249,7 +273,7 @@ template _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 inline void __debug_db_invalidate_all(_Tp* __c) { -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE if (!__libcpp_is_constant_evaluated()) __get_db()->__invalidate_all(__c); #else diff --git a/libcxx/include/__format/buffer.h b/libcxx/include/__format/buffer.h --- a/libcxx/include/__format/buffer.h +++ b/libcxx/include/__format/buffer.h @@ -119,7 +119,7 @@ template concept __enable_direct_output = __formatter::__char_type<_CharT> && (same_as<_OutIt, _CharT*> -#if _LIBCPP_DEBUG_LEVEL < 2 +#ifndef _LIBCPP_ENABLE_DEBUG_MODE || same_as<_OutIt, __wrap_iter<_CharT*>> #endif ); diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table --- a/libcxx/include/__hash_table +++ b/libcxx/include/__hash_table @@ -294,7 +294,7 @@ _VSTD::__debug_db_insert_i(this); } -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE _LIBCPP_INLINE_VISIBILITY __hash_iterator(const __hash_iterator& __i) : __node_(__i.__node_) @@ -318,7 +318,7 @@ } return *this; } -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_ENABLE_DEBUG_MODE _LIBCPP_INLINE_VISIBILITY reference operator*() const { @@ -365,7 +365,7 @@ : __node_(__node) { (void)__c; -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE __get_db()->__insert_ic(this, __c); #endif } @@ -404,12 +404,12 @@ __hash_const_iterator(const __non_const_iterator& __x) _NOEXCEPT : __node_(__x.__node_) { -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE __get_db()->__iterator_copy(this, _VSTD::addressof(__x)); #endif } -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE _LIBCPP_INLINE_VISIBILITY __hash_const_iterator(const __hash_const_iterator& __i) : __node_(__i.__node_) @@ -433,7 +433,7 @@ } return *this; } -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_ENABLE_DEBUG_MODE _LIBCPP_INLINE_VISIBILITY reference operator*() const { @@ -479,7 +479,7 @@ : __node_(__node) { (void)__c; -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE __get_db()->__insert_ic(this, __c); #endif } @@ -511,7 +511,7 @@ _VSTD::__debug_db_insert_i(this); } -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE _LIBCPP_INLINE_VISIBILITY __hash_local_iterator(const __hash_local_iterator& __i) : __node_(__i.__node_), @@ -539,7 +539,7 @@ } return *this; } -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_ENABLE_DEBUG_MODE _LIBCPP_INLINE_VISIBILITY reference operator*() const { @@ -591,7 +591,7 @@ __bucket_count_(__bucket_count) { (void)__c; -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE __get_db()->__insert_ic(this, __c); #endif if (__node_ != nullptr) @@ -639,12 +639,12 @@ __bucket_(__x.__bucket_), __bucket_count_(__x.__bucket_count_) { -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE __get_db()->__iterator_copy(this, _VSTD::addressof(__x)); #endif } -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE _LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator(const __hash_const_local_iterator& __i) : __node_(__i.__node_), @@ -672,7 +672,7 @@ } return *this; } -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_ENABLE_DEBUG_MODE _LIBCPP_INLINE_VISIBILITY reference operator*() const { @@ -724,7 +724,7 @@ __bucket_count_(__bucket_count) { (void)__c; -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE __get_db()->__insert_ic(this, __c); #endif if (__node_ != nullptr) @@ -1281,14 +1281,14 @@ return const_local_iterator(nullptr, __n, bucket_count(), this); } -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE bool __dereferenceable(const const_iterator* __i) const; bool __decrementable(const const_iterator* __i) const; bool __addable(const const_iterator* __i, ptrdiff_t __n) const; bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const; -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_ENABLE_DEBUG_MODE private: void __rehash(size_type __n); @@ -1510,7 +1510,7 @@ while (__np != nullptr) { __next_pointer __next = __np->__next_; -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE __c_node* __c = __get_db()->__find_c_and_lock(this); for (__i_node** __p = __c->end_; __p != __c->beg_; ) { @@ -2480,7 +2480,7 @@ __pn->__next_ = __cn->__next_; __cn->__next_ = nullptr; --size(); -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE __c_node* __c = __get_db()->__find_c_and_lock(this); for (__i_node** __dp = __c->end_; __dp != __c->beg_; ) { @@ -2663,7 +2663,7 @@ __x.swap(__y); } -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE template bool @@ -2693,7 +2693,7 @@ return false; } -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_ENABLE_DEBUG_MODE _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__iterator/wrap_iter.h b/libcxx/include/__iterator/wrap_iter.h --- a/libcxx/include/__iterator/wrap_iter.h +++ b/libcxx/include/__iterator/wrap_iter.h @@ -50,12 +50,12 @@ typename enable_if::value>::type* = nullptr) _NOEXCEPT : __i(__u.base()) { -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE if (!__libcpp_is_constant_evaluated()) __get_db()->__iterator_copy(this, _VSTD::addressof(__u)); #endif } -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 __wrap_iter(const __wrap_iter& __x) : __i(__x.base()) @@ -139,7 +139,7 @@ explicit __wrap_iter(const void* __p, iterator_type __x) _NOEXCEPT : __i(__x) { (void)__p; -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE if (!__libcpp_is_constant_evaluated()) __get_db()->__insert_ic(this, __p); #endif diff --git a/libcxx/include/list b/libcxx/include/list --- a/libcxx/include/list +++ b/libcxx/include/list @@ -304,7 +304,7 @@ : __ptr_(__p) { (void)__c; -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE __get_db()->__insert_ic(this, __c); #endif } @@ -325,7 +325,7 @@ _VSTD::__debug_db_insert_i(this); } -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE _LIBCPP_INLINE_VISIBILITY __list_iterator(const __list_iterator& __p) @@ -351,7 +351,7 @@ return *this; } -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_ENABLE_DEBUG_MODE _LIBCPP_INLINE_VISIBILITY reference operator*() const @@ -413,7 +413,7 @@ : __ptr_(__p) { (void)__c; -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE __get_db()->__insert_ic(this, __c); #endif } @@ -436,12 +436,12 @@ __list_const_iterator(const __list_iterator<_Tp, _VoidPtr>& __p) _NOEXCEPT : __ptr_(__p.__ptr_) { -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE __get_db()->__iterator_copy(this, _VSTD::addressof(__p)); #endif } -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE _LIBCPP_INLINE_VISIBILITY __list_const_iterator(const __list_const_iterator& __p) @@ -467,7 +467,7 @@ return *this; } -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_ENABLE_DEBUG_MODE _LIBCPP_INLINE_VISIBILITY reference operator*() const { @@ -750,7 +750,7 @@ else __c.__end_.__prev_->__next_ = __c.__end_.__next_->__prev_ = __c.__end_as_link(); -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE __libcpp_db* __db = __get_db(); __c_node* __cn1 = __db->__find_c_and_lock(this); __c_node* __cn2 = __db->__find_c(_VSTD::addressof(__c)); @@ -1075,14 +1075,14 @@ return __hold_pointer(__p, __node_destructor(__na, 1)); } -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE bool __dereferenceable(const const_iterator* __i) const; bool __decrementable(const const_iterator* __i) const; bool __addable(const const_iterator* __i, ptrdiff_t __n) const; bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const; -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_ENABLE_DEBUG_MODE private: _LIBCPP_INLINE_VISIBILITY @@ -1624,7 +1624,7 @@ __link_pointer __n = base::__end_.__next_; base::__unlink_nodes(__n, __n); --base::__sz(); -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE __c_node* __c = __get_db()->__find_c_and_lock(this); for (__i_node** __p = __c->end_; __p != __c->beg_; ) { @@ -1653,7 +1653,7 @@ __link_pointer __n = base::__end_.__prev_; base::__unlink_nodes(__n, __n); --base::__sz(); -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE __c_node* __c = __get_db()->__find_c_and_lock(this); for (__i_node** __p = __c->end_; __p != __c->beg_; ) { @@ -1686,7 +1686,7 @@ __link_pointer __r = __n->__next_; base::__unlink_nodes(__n, __n); --base::__sz(); -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE __c_node* __c = __get_db()->__find_c_and_lock(this); for (__i_node** __ip = __c->end_; __ip != __c->beg_; ) { @@ -1724,7 +1724,7 @@ __link_pointer __n = __f.__ptr_; ++__f; --base::__sz(); -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE __c_node* __c = __get_db()->__find_c_and_lock(this); for (__i_node** __p = __c->end_; __p != __c->beg_; ) { @@ -1862,7 +1862,7 @@ __link_nodes(__p.__ptr_, __f, __l); base::__sz() += __c.__sz(); __c.__sz() = 0; -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE if (_VSTD::addressof(__c) != this) { __libcpp_db* __db = __get_db(); __c_node* __cn1 = __db->__find_c_and_lock(this); @@ -1903,7 +1903,7 @@ __link_nodes(__p.__ptr_, __f, __f); --__c.__sz(); ++base::__sz(); -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE if (_VSTD::addressof(__c) != this) { __libcpp_db* __db = __get_db(); __c_node* __cn1 = __db->__find_c_and_lock(this); @@ -1964,7 +1964,7 @@ } base::__unlink_nodes(__first, __last); __link_nodes(__p.__ptr_, __first, __last); -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE if (_VSTD::addressof(__c) != this) { __libcpp_db* __db = __get_db(); __c_node* __cn1 = __db->__find_c_and_lock(this); @@ -2101,7 +2101,7 @@ ++__f1; } splice(__e1, __c); -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE __libcpp_db* __db = __get_db(); __c_node* __cn1 = __db->__find_c_and_lock(this); __c_node* __cn2 = __db->__find_c(_VSTD::addressof(__c)); @@ -2225,7 +2225,7 @@ return size() == _VSTD::distance(begin(), end()); } -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE template bool @@ -2255,7 +2255,7 @@ return false; } -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_ENABLE_DEBUG_MODE template inline _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/locale b/libcxx/include/locale --- a/libcxx/include/locale +++ b/libcxx/include/locale @@ -1461,7 +1461,7 @@ return do_put(__s, __iob, __fl, (unsigned long)__v); const numpunct& __np = use_facet >(__iob.getloc()); typedef typename numpunct::string_type string_type; -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE string_type __tmp(__v ? __np.truename() : __np.falsename()); string_type __nm = _VSTD::move(__tmp); #else diff --git a/libcxx/include/span b/libcxx/include/span --- a/libcxx/include/span +++ b/libcxx/include/span @@ -197,7 +197,7 @@ is_convertible_v>(*)[], _ElementType(*)[]>; #endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) -#if (_LIBCPP_DEBUG_LEVEL == 2) || defined(_LIBCPP_ABI_SPAN_POINTER_ITERATORS) +#if defined(_LIBCPP_ENABLE_DEBUG_MODE) || defined(_LIBCPP_ABI_SPAN_POINTER_ITERATORS) # define _LIBCPP_SPAN_USE_POINTER_ITERATOR #endif diff --git a/libcxx/include/string b/libcxx/include/string --- a/libcxx/include/string +++ b/libcxx/include/string @@ -1450,14 +1450,14 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 void __clear_and_shrink() _NOEXCEPT; -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE bool __dereferenceable(const const_iterator* __i) const; bool __decrementable(const const_iterator* __i) const; bool __addable(const const_iterator* __i, ptrdiff_t __n) const; bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const; -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_ENABLE_DEBUG_MODE private: template @@ -1840,7 +1840,7 @@ void basic_string<_CharT, _Traits, _Allocator>::__invalidate_iterators_past(size_type __pos) { -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE if (!__libcpp_is_constant_evaluated()) { __c_node* __c = __get_db()->__find_c_and_lock(this); if (__c) @@ -1862,7 +1862,7 @@ } #else (void)__pos; -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_ENABLE_DEBUG_MODE } template @@ -4595,7 +4595,7 @@ } #endif -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE template bool @@ -4629,7 +4629,7 @@ return data() <= __p && __p < data() + size(); } -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_ENABLE_DEBUG_MODE #if _LIBCPP_STD_VER > 11 // Literal suffixes for basic_string [basic.string.literals] diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -1512,7 +1512,7 @@ _LIBCPP_INLINE_VISIBILITY void reserve(size_type __n) {__table_.reserve(__n);} -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE bool __dereferenceable(const const_iterator* __i) const {return __table_.__dereferenceable(_VSTD::addressof(__i->__i_));} @@ -1523,7 +1523,7 @@ bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const {return __table_.__addable(_VSTD::addressof(__i->__i_), __n);} -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_ENABLE_DEBUG_MODE private: @@ -2288,7 +2288,7 @@ _LIBCPP_INLINE_VISIBILITY void reserve(size_type __n) {__table_.reserve(__n);} -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE bool __dereferenceable(const const_iterator* __i) const {return __table_.__dereferenceable(_VSTD::addressof(__i->__i_));} @@ -2299,7 +2299,7 @@ bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const {return __table_.__addable(_VSTD::addressof(__i->__i_), __n);} -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_ENABLE_DEBUG_MODE }; diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set --- a/libcxx/include/unordered_set +++ b/libcxx/include/unordered_set @@ -843,7 +843,7 @@ _LIBCPP_INLINE_VISIBILITY void reserve(size_type __n) {__table_.reserve(__n);} -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE bool __dereferenceable(const const_iterator* __i) const {return __table_.__dereferenceable(__i);} @@ -854,7 +854,7 @@ bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const {return __table_.__addable(__i, __n);} -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_ENABLE_DEBUG_MODE }; @@ -1481,7 +1481,7 @@ _LIBCPP_INLINE_VISIBILITY void reserve(size_type __n) {__table_.reserve(__n);} -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE bool __dereferenceable(const const_iterator* __i) const {return __table_.__dereferenceable(__i);} @@ -1492,7 +1492,7 @@ bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const {return __table_.__addable(__i, __n);} -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_ENABLE_DEBUG_MODE }; diff --git a/libcxx/include/vector b/libcxx/include/vector --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -634,14 +634,14 @@ bool __invariants() const; -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE bool __dereferenceable(const const_iterator* __i) const; bool __decrementable(const const_iterator* __i) const; bool __addable(const const_iterator* __i, ptrdiff_t __n) const; bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const; -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_ENABLE_DEBUG_MODE private: pointer __begin_ = nullptr; @@ -1898,7 +1898,7 @@ return true; } -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE template bool @@ -1930,13 +1930,13 @@ return this->__begin_ <= __p && __p < this->__end_; } -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_ENABLE_DEBUG_MODE template inline _LIBCPP_INLINE_VISIBILITY void vector<_Tp, _Allocator>::__invalidate_iterators_past(pointer __new_last) { -#if _LIBCPP_DEBUG_LEVEL == 2 +#ifdef _LIBCPP_ENABLE_DEBUG_MODE __c_node* __c = __get_db()->__find_c_and_lock(this); for (__i_node** __p = __c->end_; __p != __c->beg_; ) { --__p; diff --git a/libcxx/lib/abi/CMakeLists.txt b/libcxx/lib/abi/CMakeLists.txt --- a/libcxx/lib/abi/CMakeLists.txt +++ b/libcxx/lib/abi/CMakeLists.txt @@ -55,6 +55,11 @@ else() set(triple "${LLVM_DEFAULT_TARGET_TRIPLE}") endif() +if (LIBCXX_ENABLE_DEBUG_MODE OR LIBCXX_ENABLE_BACKWARDS_COMPATIBILITY_DEBUG_MODE_SYMBOLS) + set(has_debug_symbols ON) +else() + set(has_debug_symbols OFF) +endif() cxx_abi_list_identifier(abi_list_identifier "${triple}" "${LIBCXX_CXX_ABI}" @@ -62,7 +67,7 @@ "${LIBCXX_ABI_UNSTABLE}" "${LIBCXX_ENABLE_EXCEPTIONS}" "${LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS}" - "${LIBCXX_ENABLE_DEBUG_MODE_SUPPORT}" + "${has_debug_symbols}" "${LIBCXX_ENABLE_INCOMPLETE_FEATURES}" ) diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt --- a/libcxx/src/CMakeLists.txt +++ b/libcxx/src/CMakeLists.txt @@ -64,7 +64,7 @@ vector.cpp ) -if (LIBCXX_ENABLE_DEBUG_MODE_SUPPORT) +if (LIBCXX_ENABLE_DEBUG_MODE OR LIBCXX_ENABLE_BACKWARDS_COMPATIBILITY_DEBUG_MODE_SYMBOLS) list(APPEND LIBCXX_SOURCES debug.cpp legacy_debug_handler.cpp diff --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt --- a/libcxx/test/CMakeLists.txt +++ b/libcxx/test/CMakeLists.txt @@ -101,10 +101,6 @@ serialize_lit_param(enable_rtti False) endif() -if (NOT LIBCXX_ENABLE_DEBUG_MODE_SUPPORT) - serialize_lit_param(enable_debug_tests False) -endif() - if (LIBCXX_ENABLE_ASSERTIONS) serialize_lit_param(enable_assertions True) endif() diff --git a/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy.pass.cpp b/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy.pass.cpp --- a/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy.pass.cpp +++ b/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy.pass.cpp @@ -7,7 +7,10 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 -// UNSUPPORTED: debug_level=1 + +// When the debug mode is enabled, we don't unwrap iterators in std::copy +// so we don't get this optimization. +// UNSUPPORTED: libcpp-has-debug-mode // @@ -59,7 +62,9 @@ return *this; } - friend constexpr NotIncrementableIt operator+(const NotIncrementableIt& it, ptrdiff_t size) { return it.i + size; } + friend constexpr NotIncrementableIt operator+(const NotIncrementableIt& it, difference_type size) { return it.i + size; } + friend constexpr difference_type operator-(const NotIncrementableIt& x, const NotIncrementableIt& y) { return x.i - y.i; } + friend constexpr NotIncrementableIt operator-(const NotIncrementableIt& x, difference_type size) { return NotIncrementableIt(x.i - size); } }; static_assert(std::__is_cpp17_contiguous_iterator>::value); diff --git a/libcxx/test/libcxx/algorithms/alg.sorting/alg.heap.operations/make.heap/complexity.pass.cpp b/libcxx/test/libcxx/algorithms/alg.sorting/alg.heap.operations/make.heap/complexity.pass.cpp --- a/libcxx/test/libcxx/algorithms/alg.sorting/alg.heap.operations/make.heap/complexity.pass.cpp +++ b/libcxx/test/libcxx/algorithms/alg.sorting/alg.heap.operations/make.heap/complexity.pass.cpp @@ -64,7 +64,7 @@ std::make_heap(v.begin(), v.end()); assert(stats.copied == 0); assert(stats.moved == 153'486); -#ifndef _LIBCPP_DEBUG +#ifndef _LIBCPP_ENABLE_DEBUG_MODE assert(stats.compared == 188'285); #endif diff --git a/libcxx/test/libcxx/algorithms/alg.sorting/alg.heap.operations/sort.heap/complexity.pass.cpp b/libcxx/test/libcxx/algorithms/alg.sorting/alg.heap.operations/sort.heap/complexity.pass.cpp --- a/libcxx/test/libcxx/algorithms/alg.sorting/alg.heap.operations/sort.heap/complexity.pass.cpp +++ b/libcxx/test/libcxx/algorithms/alg.sorting/alg.heap.operations/sort.heap/complexity.pass.cpp @@ -65,7 +65,7 @@ std::sort_heap(v.begin(), v.end()); assert(stats.copied == 0); assert(stats.moved == 1'764'997); -#ifndef _LIBCPP_DEBUG +#ifndef _LIBCPP_ENABLE_DEBUG_MODE assert(stats.compared == 1'534'701); #endif diff --git a/libcxx/test/libcxx/algorithms/debug_less.inconsistent.pass.cpp b/libcxx/test/libcxx/algorithms/debug_less.inconsistent.pass.cpp --- a/libcxx/test/libcxx/algorithms/debug_less.inconsistent.pass.cpp +++ b/libcxx/test/libcxx/algorithms/debug_less.inconsistent.pass.cpp @@ -13,8 +13,7 @@ // Make sure __debug_less asserts when the comparator is not consistent. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/algorithms/debug_less.pass.cpp b/libcxx/test/libcxx/algorithms/debug_less.pass.cpp --- a/libcxx/test/libcxx/algorithms/debug_less.pass.cpp +++ b/libcxx/test/libcxx/algorithms/debug_less.pass.cpp @@ -13,8 +13,7 @@ // __debug_less checks that a comparator actually provides a strict-weak ordering. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/algorithms/nth_element_stability.pass.cpp b/libcxx/test/libcxx/algorithms/nth_element_stability.pass.cpp --- a/libcxx/test/libcxx/algorithms/nth_element_stability.pass.cpp +++ b/libcxx/test/libcxx/algorithms/nth_element_stability.pass.cpp @@ -10,8 +10,8 @@ // Test std::nth_element stability randomization -// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: c++03 +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY #include #include diff --git a/libcxx/test/libcxx/algorithms/partial_sort_stability.pass.cpp b/libcxx/test/libcxx/algorithms/partial_sort_stability.pass.cpp --- a/libcxx/test/libcxx/algorithms/partial_sort_stability.pass.cpp +++ b/libcxx/test/libcxx/algorithms/partial_sort_stability.pass.cpp @@ -10,8 +10,8 @@ // Test std::partial_sort stability randomization -// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: c++03 +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY #include #include diff --git a/libcxx/test/libcxx/algorithms/sort_stability.pass.cpp b/libcxx/test/libcxx/algorithms/sort_stability.pass.cpp --- a/libcxx/test/libcxx/algorithms/sort_stability.pass.cpp +++ b/libcxx/test/libcxx/algorithms/sort_stability.pass.cpp @@ -10,8 +10,8 @@ // Test std::sort stability randomization -// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: c++03 +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY #include #include diff --git a/libcxx/test/libcxx/containers/sequences/list/list.cons/debug.copy.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.cons/debug.copy.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/list/list.cons/debug.copy.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/list/list.cons/debug.copy.pass.cpp @@ -11,8 +11,7 @@ // list(list&& c); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.emplace.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.emplace.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.emplace.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.emplace.pass.cpp @@ -11,8 +11,7 @@ // template void emplace(const_iterator p, Args&&... args); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter.pass.cpp @@ -11,8 +11,7 @@ // Call erase(const_iterator position) with iterator from another container // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter_iter.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter_iter.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter_iter.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter_iter.pass.cpp @@ -11,8 +11,7 @@ // Call erase(const_iterator first, const_iterator last); with various invalid iterators // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_iter_iter.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_iter_iter.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_iter_iter.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_iter_iter.pass.cpp @@ -12,8 +12,7 @@ // iterator insert(const_iterator position, Iter first, Iter last); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_rvalue.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_rvalue.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_rvalue.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_rvalue.pass.cpp @@ -11,8 +11,7 @@ // iterator insert(const_iterator position, value_type&& x); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_size_value.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_size_value.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_size_value.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_size_value.pass.cpp @@ -11,8 +11,7 @@ // iterator insert(const_iterator position, size_type n, const value_type& x); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_value.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_value.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_value.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_value.pass.cpp @@ -11,8 +11,7 @@ // iterator insert(const_iterator position, const value_type& x); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list.pass.cpp @@ -11,8 +11,7 @@ // void splice(const_iterator position, list& x); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter.pass.cpp @@ -11,8 +11,7 @@ // void splice(const_iterator position, list& x, iterator i); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter_iter.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter_iter.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter_iter.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter_iter.pass.cpp @@ -11,8 +11,7 @@ // void splice(const_iterator position, list& x, iterator first, iterator last); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.add.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.add.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.add.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.add.pass.cpp @@ -11,8 +11,7 @@ // Add to iterator out of bounds. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.compare.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.compare.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.compare.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.compare.pass.cpp @@ -11,8 +11,7 @@ // Compare iterators from different containers with <. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.decrement.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.decrement.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.decrement.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.decrement.pass.cpp @@ -11,8 +11,7 @@ // Decrement iterator prior to begin. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.dereference.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.dereference.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.dereference.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.dereference.pass.cpp @@ -11,8 +11,7 @@ // Dereference non-dereferenceable iterator. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.increment.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.increment.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.increment.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.increment.pass.cpp @@ -11,8 +11,7 @@ // Increment iterator past end. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.index.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.index.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.index.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.index.pass.cpp @@ -11,8 +11,7 @@ // Index iterator out of bounds. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.subtract.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.subtract.pass.cpp --- a/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.subtract.pass.cpp +++ b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.subtract.pass.cpp @@ -11,8 +11,7 @@ // Subtract iterators from different containers. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_const_lvalue.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_const_lvalue.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_const_lvalue.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_const_lvalue.pass.cpp @@ -11,8 +11,7 @@ // iterator insert(const_iterator p, const value_type& x); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_rvalue.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_rvalue.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_rvalue.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_rvalue.pass.cpp @@ -13,8 +13,7 @@ // iterator insert(const_iterator p, P&& x); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.map/debug.iterator.dereference.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/debug.iterator.dereference.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.map/debug.iterator.dereference.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.map/debug.iterator.dereference.pass.cpp @@ -11,8 +11,7 @@ // Dereference non-dereferenceable iterator. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/containers/unord/unord.map/debug.iterator.increment.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/debug.iterator.increment.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.map/debug.iterator.increment.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.map/debug.iterator.increment.pass.cpp @@ -11,8 +11,7 @@ // Increment iterator past end. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/containers/unord/unord.map/debug.local_iterator.dereference.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/debug.local_iterator.dereference.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.map/debug.local_iterator.dereference.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.map/debug.local_iterator.dereference.pass.cpp @@ -11,8 +11,7 @@ // Dereference non-dereferenceable iterator. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/containers/unord/unord.map/debug.local_iterator.increment.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/debug.local_iterator.increment.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.map/debug.local_iterator.increment.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.map/debug.local_iterator.increment.pass.cpp @@ -11,8 +11,7 @@ // Increment local_iterator past end. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/containers/unord/unord.map/debug.swap.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/debug.swap.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.map/debug.swap.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.map/debug.swap.pass.cpp @@ -15,8 +15,7 @@ // void swap(unordered_map& x, unordered_map& y); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/debug.erase.iter.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/debug.erase.iter.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/debug.erase.iter.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/debug.erase.iter.pass.cpp @@ -11,8 +11,7 @@ // Call erase(const_iterator position) with invalid iterators // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/debug.erase.iter_iter.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/debug.erase.iter_iter.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/debug.erase.iter_iter.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/debug.erase.iter_iter.pass.cpp @@ -11,8 +11,7 @@ // Call erase(const_iterator first, const_iterator last); with invalid iterators // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_const_lvalue.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_const_lvalue.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_const_lvalue.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_const_lvalue.pass.cpp @@ -11,8 +11,7 @@ // iterator insert(const_iterator p, const value_type& x); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_rvalue.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_rvalue.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_rvalue.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_rvalue.pass.cpp @@ -13,8 +13,7 @@ // iterator insert(const_iterator p, P&& x); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/debug.iterator.dereference.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.iterator.dereference.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multimap/debug.iterator.dereference.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.iterator.dereference.pass.cpp @@ -11,8 +11,7 @@ // Dereference non-dereferenceable iterator. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/debug.iterator.increment.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.iterator.increment.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multimap/debug.iterator.increment.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.iterator.increment.pass.cpp @@ -11,8 +11,7 @@ // Increment iterator past end. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/debug.local_iterator.dereference.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.local_iterator.dereference.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multimap/debug.local_iterator.dereference.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.local_iterator.dereference.pass.cpp @@ -11,8 +11,7 @@ // Dereference non-dereferenceable iterator. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/debug.local_iterator.increment.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.local_iterator.increment.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multimap/debug.local_iterator.increment.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.local_iterator.increment.pass.cpp @@ -11,8 +11,7 @@ // Increment local_iterator past end. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/debug.swap.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.swap.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multimap/debug.swap.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.swap.pass.cpp @@ -15,8 +15,7 @@ // void swap(unordered_multimap& x, unordered_multimap& y); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/debug.erase.iter.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/debug.erase.iter.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/debug.erase.iter.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/debug.erase.iter.pass.cpp @@ -11,8 +11,7 @@ // Call erase(const_iterator position) with invalid iterators // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/debug.erase.iter_iter.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/debug.erase.iter_iter.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/debug.erase.iter_iter.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/debug.erase.iter_iter.pass.cpp @@ -11,8 +11,7 @@ // Call erase(const_iterator first, const_iterator last); with invalid iterators // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter.pass.cpp @@ -11,8 +11,7 @@ // Call erase(const_iterator position) with invalid iterators // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter_iter.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter_iter.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter_iter.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter_iter.pass.cpp @@ -11,8 +11,7 @@ // Call erase(const_iterator first, const_iterator last); with invalid iterators // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.insert.hint_const_lvalue.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.insert.hint_const_lvalue.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.insert.hint_const_lvalue.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.insert.hint_const_lvalue.pass.cpp @@ -11,8 +11,7 @@ // iterator insert(const_iterator p, const value_type& x); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.iterator.dereference.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.iterator.dereference.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.iterator.dereference.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.iterator.dereference.pass.cpp @@ -11,8 +11,7 @@ // Dereference non-dereferenceable iterator. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.iterator.increment.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.iterator.increment.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.iterator.increment.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.iterator.increment.pass.cpp @@ -11,8 +11,7 @@ // Increment iterator past end. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.local_iterator.dereference.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.local_iterator.dereference.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.local_iterator.dereference.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.local_iterator.dereference.pass.cpp @@ -11,8 +11,7 @@ // Dereference non-dereferenceable iterator. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.local_iterator.increment.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.local_iterator.increment.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.local_iterator.increment.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.local_iterator.increment.pass.cpp @@ -11,8 +11,7 @@ // Increment local_iterator past end. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.swap.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.swap.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.swap.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.swap.pass.cpp @@ -15,8 +15,7 @@ // void swap(unordered_multiset& x, unordered_multiset& y); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter.pass.cpp @@ -11,8 +11,7 @@ // Call erase(const_iterator position) with invalid iterators // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter_iter.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter_iter.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter_iter.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter_iter.pass.cpp @@ -11,8 +11,7 @@ // Call erase(const_iterator first, const_iterator last); with first iterator from another container // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.set/debug.insert.hint_const_lvalue.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/debug.insert.hint_const_lvalue.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.set/debug.insert.hint_const_lvalue.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.set/debug.insert.hint_const_lvalue.pass.cpp @@ -11,8 +11,7 @@ // iterator insert(const_iterator p, const value_type& x); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.set/debug.iterator.dereference.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/debug.iterator.dereference.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.set/debug.iterator.dereference.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.set/debug.iterator.dereference.pass.cpp @@ -11,8 +11,7 @@ // Dereference non-dereferenceable iterator. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.set/debug.iterator.increment.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/debug.iterator.increment.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.set/debug.iterator.increment.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.set/debug.iterator.increment.pass.cpp @@ -11,8 +11,7 @@ // Increment iterator past end. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/containers/unord/unord.set/debug.local_iterator.dereference.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/debug.local_iterator.dereference.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.set/debug.local_iterator.dereference.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.set/debug.local_iterator.dereference.pass.cpp @@ -11,8 +11,7 @@ // Dereference non-dereferenceable iterator. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/containers/unord/unord.set/debug.local_iterator.increment.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/debug.local_iterator.increment.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.set/debug.local_iterator.increment.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.set/debug.local_iterator.increment.pass.cpp @@ -11,8 +11,7 @@ // Increment local_iterator past end. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/containers/unord/unord.set/debug.swap.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/debug.swap.pass.cpp --- a/libcxx/test/libcxx/containers/unord/unord.set/debug.swap.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/unord.set/debug.swap.pass.cpp @@ -15,8 +15,7 @@ // void swap(unordered_set& x, unordered_set& y); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/debug/containers.multithread.pass.cpp b/libcxx/test/libcxx/debug/containers.multithread.pass.cpp --- a/libcxx/test/libcxx/debug/containers.multithread.pass.cpp +++ b/libcxx/test/libcxx/debug/containers.multithread.pass.cpp @@ -9,8 +9,7 @@ // UNSUPPORTED: c++11, c++14 // UNSUPPORTED: no-threads -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 // test multithreaded container debugging diff --git a/libcxx/test/libcxx/debug/containers/associative_containers.pass.cpp b/libcxx/test/libcxx/debug/containers/associative_containers.pass.cpp --- a/libcxx/test/libcxx/debug/containers/associative_containers.pass.cpp +++ b/libcxx/test/libcxx/debug/containers/associative_containers.pass.cpp @@ -7,8 +7,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03, c++11, c++14 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03, c++11, c++14 // test container debugging diff --git a/libcxx/test/libcxx/debug/containers/sequence_container_iterators.pass.cpp b/libcxx/test/libcxx/debug/containers/sequence_container_iterators.pass.cpp --- a/libcxx/test/libcxx/debug/containers/sequence_container_iterators.pass.cpp +++ b/libcxx/test/libcxx/debug/containers/sequence_container_iterators.pass.cpp @@ -7,8 +7,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03, c++11, c++14 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03, c++11, c++14 // test container debugging diff --git a/libcxx/test/libcxx/debug/containers/string.pass.cpp b/libcxx/test/libcxx/debug/containers/string.pass.cpp --- a/libcxx/test/libcxx/debug/containers/string.pass.cpp +++ b/libcxx/test/libcxx/debug/containers/string.pass.cpp @@ -7,8 +7,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03, c++11, c++14 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03, c++11, c++14 // test container debugging diff --git a/libcxx/test/libcxx/debug/containers/unord_containers.pass.cpp b/libcxx/test/libcxx/debug/containers/unord_containers.pass.cpp --- a/libcxx/test/libcxx/debug/containers/unord_containers.pass.cpp +++ b/libcxx/test/libcxx/debug/containers/unord_containers.pass.cpp @@ -7,8 +7,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03, c++11, c++14 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03, c++11, c++14 // test container debugging diff --git a/libcxx/test/libcxx/debug/debug.assertions-enabled.compile.pass.cpp b/libcxx/test/libcxx/debug/debug.assertions-enabled.compile.pass.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/debug/debug.assertions-enabled.compile.pass.cpp @@ -0,0 +1,17 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// This test ensures that assertions are enabled by default when the debug mode is enabled. + +// REQUIRES: libcpp-has-debug-mode + +#include + +#if !defined(_LIBCPP_ENABLE_ASSERTIONS) || _LIBCPP_ENABLE_ASSERTIONS == 0 +# error "Assertions should be enabled automatically when the debug mode is enabled" +#endif diff --git a/libcxx/test/libcxx/debug/debug.catch-legacy-macro.verify.cpp b/libcxx/test/libcxx/debug/debug.catch-legacy-macro.verify.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/debug/debug.catch-legacy-macro.verify.cpp @@ -0,0 +1,21 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// This test ensures that we issue an error if we try to enable the debug mode with +// a library that was not built with support for the debug mode. + +// REQUIRES: !libcpp-has-debug-mode +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 + +// This test fails when modules are enabled because we fail to build module 'std' instead of +// issuing the preprocessor error. +// UNSUPPORTED: modules-build + +#include <__debug> + +// expected-error@*:* {{Enabling the debug mode now requires having configured the library with support for the debug mode}} diff --git a/libcxx/test/libcxx/debug/extern-templates.sh.cpp b/libcxx/test/libcxx/debug/extern-templates.sh.cpp --- a/libcxx/test/libcxx/debug/extern-templates.sh.cpp +++ b/libcxx/test/libcxx/debug/extern-templates.sh.cpp @@ -10,7 +10,7 @@ // for members of even when the debug mode is enabled, which is // necessary for correctness. See https://llvm.org/D94718 for details. -// UNSUPPORTED: libcxx-no-debug-mode +// UNSUPPORTED: !libcpp-has-debug-mode // UNSUPPORTED: no-localization // UNSUPPORTED: cant-build-shared-library @@ -23,8 +23,8 @@ // XFAIL: LIBCXX-AIX-FIXME -// RUN: %{cxx} %{flags} %{compile_flags} %s %{link_flags} -fPIC -DTU1 -D_LIBCPP_DEBUG=1 -fvisibility=hidden -shared -o %t.lib -// RUN: cd %T && %{cxx} %{flags} %{compile_flags} %s ./%basename_t.tmp.lib %{link_flags} -DTU2 -D_LIBCPP_DEBUG=1 -fvisibility=hidden -o %t.exe +// RUN: %{cxx} %{flags} %{compile_flags} %s %{link_flags} -fPIC -DTU1 -fvisibility=hidden -shared -o %t.lib +// RUN: cd %T && %{cxx} %{flags} %{compile_flags} %s ./%basename_t.tmp.lib %{link_flags} -DTU2 -fvisibility=hidden -o %t.exe // RUN: %{exec} %t.exe #include diff --git a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/assert.equal.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/assert.equal.pass.cpp --- a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/assert.equal.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/assert.equal.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers -// UNSUPPORTED: c++03, c++11, c++14, c++17, libcxx-no-debug-mode, libcpp-has-no-incomplete-ranges +// UNSUPPORTED: c++03, c++11, c++14, c++17, !libcpp-has-debug-mode, libcpp-has-no-incomplete-ranges // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1 // diff --git a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/assert.equal.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/assert.equal.pass.cpp --- a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/assert.equal.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/assert.equal.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers -// UNSUPPORTED: c++03, c++11, c++14, c++17, libcxx-no-debug-mode, libcpp-has-no-incomplete-ranges +// UNSUPPORTED: c++03, c++11, c++14, c++17, !libcpp-has-debug-mode, libcpp-has-no-incomplete-ranges // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_ASSERTIONS=1 // diff --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.add.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.add.pass.cpp --- a/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.add.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.add.pass.cpp @@ -11,8 +11,7 @@ // Add to iterator out of bounds. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.compare.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.compare.pass.cpp --- a/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.compare.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.compare.pass.cpp @@ -11,8 +11,7 @@ // Compare iterators from different containers with <. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.decrement.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.decrement.pass.cpp --- a/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.decrement.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.decrement.pass.cpp @@ -11,8 +11,7 @@ // Decrement iterator prior to begin. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.dereference.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.dereference.pass.cpp --- a/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.dereference.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.dereference.pass.cpp @@ -11,8 +11,7 @@ // Dereference non-dereferenceable iterator. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.increment.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.increment.pass.cpp --- a/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.increment.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.increment.pass.cpp @@ -11,8 +11,7 @@ // Increment iterator past end. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.index.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.index.pass.cpp --- a/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.index.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.index.pass.cpp @@ -11,8 +11,7 @@ // Index iterator out of bounds. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.subtract.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.subtract.pass.cpp --- a/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.subtract.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.subtract.pass.cpp @@ -11,8 +11,7 @@ // Subtract iterators from different containers. // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.erase.iter.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.erase.iter.pass.cpp --- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.erase.iter.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.erase.iter.pass.cpp @@ -11,8 +11,7 @@ // Call erase(const_iterator position) with an iterator from another container // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.erase.iter_iter.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.erase.iter_iter.pass.cpp --- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.erase.iter_iter.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.erase.iter_iter.pass.cpp @@ -11,8 +11,7 @@ // Call erase(const_iterator first, const_iterator last); with invalid iterators // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_char.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_char.pass.cpp --- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_char.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_char.pass.cpp @@ -11,8 +11,7 @@ // iterator insert(const_iterator p, charT c); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 // TODO: Since string::insert(iter, char) is intantiated in the dylib, this test doesn't // actually work if the dylib hasn't been built with debug assertions enabled. diff --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_iter_iter.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_iter_iter.pass.cpp --- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_iter_iter.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_iter_iter.pass.cpp @@ -12,8 +12,7 @@ // iterator insert(const_iterator p, InputIterator first, InputIterator last); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_size_char.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_size_char.pass.cpp --- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_size_char.pass.cpp +++ b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_size_char.pass.cpp @@ -11,8 +11,7 @@ // iterator insert(const_iterator p, size_type n, charT c); // REQUIRES: has-unix-headers -// UNSUPPORTED: libcxx-no-debug-mode, c++03 -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1 +// UNSUPPORTED: !libcpp-has-debug-mode, c++03 #include diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp --- a/libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp @@ -79,7 +79,7 @@ assert(ia[0] == static_cast(N)-1); assert(ia[N-1] == 0); assert(std::is_sorted(ia, ia+N, std::greater())); -#ifndef _LIBCPP_DEBUG +#ifndef _LIBCPP_ENABLE_DEBUG_MODE assert(pred.count() <= (N-1)); #endif } diff --git a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp --- a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-DEBUG-FIXME - // UNSUPPORTED: c++03 // diff --git a/libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp b/libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp --- a/libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp +++ b/libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp @@ -9,11 +9,6 @@ // UNSUPPORTED: no-localization // UNSUPPORTED: libcpp-has-no-incomplete-format -// The issue is caused in __format_spec::__determine_grouping(). -// There a string iterator is modified. The string is returned -// from the dylib's use_facet>::grouping() -// XFAIL: LIBCXX-DEBUG-FIXME - // TODO FMT Evaluate gcc-11 status // UNSUPPORTED: gcc-11 diff --git a/libcxx/test/support/container_debug_tests.h b/libcxx/test/support/container_debug_tests.h --- a/libcxx/test/support/container_debug_tests.h +++ b/libcxx/test/support/container_debug_tests.h @@ -14,8 +14,8 @@ #error This header may only be used for libc++ tests #endif -#ifndef _LIBCPP_DEBUG -#error _LIBCPP_DEBUG must be defined before including this header +#ifndef _LIBCPP_ENABLE_DEBUG_MODE +#error The library must be built with the debug mode enabled in order to use this header #endif #include <__debug> diff --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml --- a/libcxx/utils/ci/buildkite-pipeline.yml +++ b/libcxx/utils/ci/buildkite-pipeline.yml @@ -379,8 +379,8 @@ limit: 2 timeout_in_minutes: 120 - - label: "Debug iterators" - command: "libcxx/utils/ci/run-buildbot generic-debug-iterators" + - label: "Debug mode" + command: "libcxx/utils/ci/run-buildbot generic-debug-mode" artifact_paths: - "**/test-results.xml" - "**/*.abilist" @@ -423,20 +423,6 @@ limit: 2 timeout_in_minutes: 120 - - label: "No debug mode" - command: "libcxx/utils/ci/run-buildbot generic-no-debug" - artifact_paths: - - "**/test-results.xml" - - "**/*.abilist" - agents: - queue: "libcxx-builders" - os: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - label: "No filesystem" command: "libcxx/utils/ci/run-buildbot generic-no-filesystem" artifact_paths: diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot --- a/libcxx/utils/ci/run-buildbot +++ b/libcxx/utils/ci/run-buildbot @@ -233,9 +233,9 @@ check-runtimes check-abi-list ;; -generic-debug-iterators) +generic-debug-mode) clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-debug-iterators.cmake" + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-debug-mode.cmake" check-runtimes check-abi-list ;; @@ -329,12 +329,6 @@ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-threads.cmake" check-runtimes ;; -generic-no-debug) - clean - generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-debug.cmake" - check-runtimes - check-abi-list -;; generic-no-filesystem) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake" diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py --- a/libcxx/utils/libcxx/test/features.py +++ b/libcxx/utils/libcxx/test/features.py @@ -191,6 +191,7 @@ '_LIBCPP_HAS_NO_INCOMPLETE_FORMAT': 'libcpp-has-no-incomplete-format', '_LIBCPP_HAS_NO_INCOMPLETE_RANGES': 'libcpp-has-no-incomplete-ranges', '_LIBCPP_HAS_NO_UNICODE': 'libcpp-has-no-unicode', + '_LIBCPP_ENABLE_DEBUG_MODE': 'libcpp-has-debug-mode', } for macro, feature in macros.items(): DEFAULT_FEATURES.append( diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py --- a/libcxx/utils/libcxx/test/params.py +++ b/libcxx/utils/libcxx/test/params.py @@ -126,15 +126,6 @@ [AddCompileFlag('-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER')] ), - Parameter(name='debug_level', choices=['', '0', '1'], type=str, default='', - help="The debugging level to enable in the test suite.", - actions=lambda debugLevel: [] if debugLevel == '' else filter(None, [ - AddFeature('debug_level={}'.format(debugLevel)), - AddCompileFlag('-Wno-macro-redefined'), - AddCompileFlag('-D_LIBCPP_DEBUG={}'.format(debugLevel)), - AddFeature('LIBCXX-DEBUG-FIXME') if debugLevel == '1' else None - ])), - Parameter(name='use_sanitizer', choices=['', 'Address', 'Undefined', 'Memory', 'MemoryWithOrigins', 'Thread', 'DataFlow', 'Leaks'], type=str, default='', help="An optional sanitizer to enable when building and running the test suite.", actions=lambda sanitizer: filter(None, [ @@ -177,12 +168,6 @@ AddFeature('long_tests') ]), - Parameter(name='enable_debug_tests', choices=[True, False], type=bool, default=True, - help="Whether to enable tests that exercise the libc++ debugging mode.", - actions=lambda enabled: [] if enabled else [ - AddFeature('libcxx-no-debug-mode') - ]), - Parameter(name='enable_assertions', choices=[True, False], type=bool, default=False, help="Whether to enable assertions when compiling the test suite. This is only meaningful when " "running the tests against libc++.",