[libc++] Always build c++experimental.a
authorLouis Dionne <ldionne.2@gmail.com>
Thu, 30 Jun 2022 15:24:43 +0000 (11:24 -0400)
committerLouis Dionne <ldionne.2@gmail.com>
Fri, 8 Jul 2022 20:58:22 +0000 (16:58 -0400)
This is the first part of a plan to ship experimental features
by default while guarding them behind a compiler flag to avoid
users accidentally depending on them. Subsequent patches will
also encompass incomplete features (such as <format> and <ranges>)
in that categorization. Basically, the idea is that we always
build and ship the c++experimental library, however users can't
use what's in it unless they pass the `-funstable` flag to Clang.

Note that this patch intentionally does not start guarding
existing <experimental/FOO> content behind the flag, because
that would merely break users that might be relying on such
content being in the headers unconditionally. Instead, we
should start guarding new TSes behind the flag, and get rid
of the existing TSes we have by shipping their Standard
counterpart.

Also, this patch must jump through a few hoops like defining
_LIBCPP_ENABLE_EXPERIMENTAL because we still support compilers
that do not implement -funstable yet.

Differential Revision: https://reviews.llvm.org/D128927

44 files changed:
clang/cmake/caches/Fuchsia-stage2.cmake
clang/cmake/caches/Fuchsia.cmake
compiler-rt/cmake/Modules/AddCompilerRT.cmake
libcxx/CMakeLists.txt
libcxx/appveyor.yml
libcxx/cmake/caches/AIX.cmake
libcxx/cmake/caches/Apple.cmake
libcxx/cmake/caches/Generic-no-experimental.cmake
libcxx/docs/BuildingLibcxx.rst
libcxx/docs/UsingLibcxx.rst
libcxx/src/CMakeLists.txt
libcxx/test/CMakeLists.txt
libcxx/test/libcxx/experimental/memory/memory.resource.global/global_memory_resource_lifetime.pass.cpp
libcxx/test/libcxx/experimental/memory/memory.resource.global/new_delete_resource_lifetime.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/default.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/equal.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/not_equal.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/destroy.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/resource.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.aliases/header_deque_synop.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.aliases/header_forward_list_synop.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.aliases/header_list_synop.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.aliases/header_map_synop.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.aliases/header_set_synop.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_map_synop.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_set_synop.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.aliases/header_vector_synop.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.global/default_resource.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp
libcxx/utils/ci/run-buildbot
libcxx/utils/libcxx/test/params.py

index 412dbdf71b68aa073cf906409f9c8556600115b5..67c88b306a4d48ab905f8bfab0181380e0896cb2 100644 (file)
@@ -79,7 +79,6 @@ if(WIN32)
   set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Windows CACHE STRING "")
   set(RUNTIMES_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
   set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
-  set(RUNTIMES_${target}_LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY OFF CACHE BOOL "")
   set(RUNTIMES_${target}_LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "")
   set(RUNTIMES_${target}_LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "")
   set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
index 7b534e61f952099e411805b746cdbe0e6e186548..53bb78d9ea3682afc996a30468b7af30aea6a422 100644 (file)
@@ -50,7 +50,6 @@ endif()
 
 if(WIN32)
   set(LIBCXX_ABI_VERSION 2 CACHE STRING "")
-  set(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY OFF CACHE BOOL "")
   set(LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "")
   set(LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "")
   set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
index b7eb04327bb1da88728edb1e4706a577a8905c03..00bb892be595a225e44677e31b3af04d34e8bd81 100644 (file)
@@ -685,7 +685,6 @@ macro(add_custom_libcxx name prefix)
                -DLIBCXXABI_HERMETIC_STATIC_LIBRARY=ON
                -DLIBCXXABI_INCLUDE_TESTS=OFF
                -DLIBCXX_CXX_ABI=libcxxabi
-               -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF
                -DLIBCXX_ENABLE_SHARED=OFF
                -DLIBCXX_HERMETIC_STATIC_LIBRARY=ON
                -DLIBCXX_INCLUDE_BENCHMARKS=OFF
index 3d63bb0c8fbf8622c5e1cef5c4476f309c23c1f4..0977a7229e5d89a620fee4e732f0f93c1a589f86 100644 (file)
@@ -55,7 +55,6 @@ option(LIBCXX_ENABLE_ASSERTIONS
    by users in their own code regardless of this option." OFF)
 option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON)
 option(LIBCXX_ENABLE_STATIC "Build libc++ as a static library." ON)
-option(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY "Build libc++experimental.a" ON)
 set(ENABLE_FILESYSTEM_DEFAULT ON)
 if (WIN32 AND NOT MINGW)
   # Filesystem is buildable for windows, but it requires __int128 helper
@@ -167,9 +166,6 @@ cmake_dependent_option(LIBCXX_INSTALL_STATIC_LIBRARY
 cmake_dependent_option(LIBCXX_INSTALL_SHARED_LIBRARY
   "Install the shared libc++ library." ON
   "LIBCXX_ENABLE_SHARED;LIBCXX_INSTALL_LIBRARY" OFF)
-cmake_dependent_option(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY
-        "Install libc++experimental.a" ON
-        "LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY;LIBCXX_INSTALL_LIBRARY" OFF)
 
 option(LIBCXX_ABI_UNSTABLE "Use the unstable ABI of libc++. This is equivalent to specifying LIBCXX_ABI_VERSION=n, where n is the not-yet-stable version." OFF)
 if (LIBCXX_ABI_UNSTABLE)
@@ -930,11 +926,7 @@ add_subdirectory(include)
 add_subdirectory(src)
 add_subdirectory(utils)
 
-set(LIBCXX_TEST_DEPS "")
-
-if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
-  list(APPEND LIBCXX_TEST_DEPS cxx_experimental)
-endif()
+set(LIBCXX_TEST_DEPS "cxx_experimental")
 
 if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY)
   list(APPEND LIBCXX_TEST_DEPS cxx_external_threads)
index ae7c7ad7cf67272173c2c082584f4c8703ba4038..ea2c88e5fda7fa4bdcd2bcf3d37e23d6542a92a0 100644 (file)
@@ -45,7 +45,7 @@ build_script:
   #############################################################################
   - cmake -G "%GENERATOR%" %CMAKE_OPTIONS%
     "-DCMAKE_BUILD_TYPE=%configuration%"
-    "-DLLVM_PATH=C:\projects\deps\llvm" -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF
+    "-DLLVM_PATH=C:\projects\deps\llvm"
     -DLLVM_LIT_ARGS="-sv --show-xfail --show-unsupported"
     %APPVEYOR_BUILD_FOLDER%
 
index b6c483a3172794568e5fa52ba6e6aa4bd34f358c..76cf17791301125dbb808be6b70a47f8c837c56e 100644 (file)
@@ -9,7 +9,6 @@ set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
 set(LIBCXX_ENABLE_ASSERTIONS OFF CACHE BOOL "")
 set(LIBCXX_ABI_VERSION "1" CACHE STRING "")
 set(LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "")
-set(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY OFF CACHE BOOL "")
 set(LIBCXX_ENABLE_SHARED ON CACHE BOOL "")
 set(LIBCXX_ENABLE_STATIC OFF CACHE BOOL "")
 set(LIBCXXABI_ENABLE_SHARED ON CACHE BOOL "")
index ea701a43f96a35f629858dc1a17fe277749e5f91..734f5ac8a1b9a9e44d1dedd62e801f8d2e22b898 100644 (file)
@@ -4,7 +4,6 @@ set(CMAKE_POSITION_INDEPENDENT_CODE OFF CACHE BOOL "")
 set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
 set(LIBCXX_ENABLE_ASSERTIONS OFF CACHE BOOL "")
 set(LIBCXX_ABI_VERSION "1" CACHE STRING "")
-set(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY OFF CACHE BOOL "")
 set(LIBCXX_ENABLE_STATIC ON CACHE BOOL "")
 set(LIBCXX_ENABLE_SHARED ON CACHE BOOL "")
 set(LIBCXX_CXX_ABI libcxxabi CACHE STRING "")
index 0f055f4a98e0758fa3d83cd342fd698c650cb6e4..98f01418d197d0e9e3e81731c5cdd3d76be52de0 100644 (file)
@@ -1,2 +1,3 @@
-set(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY OFF CACHE BOOL "")
+set(LIBCXX_TEST_PARAMS "enable_experimental=False" CACHE STRING "")
+set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
 set(LIBCXX_ENABLE_INCOMPLETE_FEATURES OFF CACHE BOOL "")
index 5069c7fe06928394d96e23e11b06cb7a5b0ef1c7..7c347c6b57ba5868fb3d9cdf7a02fb79a38caf0c 100644 (file)
@@ -99,8 +99,7 @@ it is the simplest way to build.
           -T "ClangCL"                                    ^
           -DLLVM_ENABLE_RUNTIMES=libcxx                   ^
           -DLIBCXX_ENABLE_SHARED=YES                      ^
-          -DLIBCXX_ENABLE_STATIC=NO                       ^
-          -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=NO
+          -DLIBCXX_ENABLE_STATIC=NO
   > cmake --build build
 
 CMake + ninja (MSVC)
@@ -131,8 +130,7 @@ In either case, then run:
   > cmake -G Ninja -S runtimes -B build                                               ^
           -DCMAKE_C_COMPILER=clang-cl                                                 ^
           -DCMAKE_CXX_COMPILER=clang-cl                                               ^
-          -DLLVM_ENABLE_RUNTIMES=libcxx                                               ^
-          -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=NO
+          -DLLVM_ENABLE_RUNTIMES=libcxx
   > ninja -C build cxx
   > ninja -C build check-cxx
 
@@ -298,23 +296,6 @@ libc++ specific options
   Path where target-specific libc++ headers should be installed. If a relative
   path, relative to ``CMAKE_INSTALL_PREFIX``.
 
-.. _libc++experimental options:
-
-libc++experimental Specific Options
-------------------------------------
-
-.. option:: LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY:BOOL
-
-  **Default**: ``ON``
-
-  Build and test libc++experimental.a.
-
-.. option:: LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY:BOOL
-
-  **Default**: ``LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY AND LIBCXX_INSTALL_LIBRARY``
-
-  Install libc++experimental.a alongside libc++.
-
 
 .. _ABI Library Specific Options:
 
index f69f9990cf314df9e75e77738916b0aac5d5f66d..343937b94149592fb6d72218999110e90a5e2564 100644 (file)
@@ -34,22 +34,20 @@ matches that Standard in the library.
   library until the standard has been ratified.
 
 
-Using libc++experimental and ``<experimental/...>``
-===================================================
+Enabling experimental C++ Library features
+==========================================
 
-Libc++ provides implementations of experimental technical specifications
-in a separate library, ``libc++experimental.a``. Users of ``<experimental/...>``
-headers may be required to link ``-lc++experimental``. Note that not all
-vendors ship ``libc++experimental.a``, and as a result, you may not be
-able to use those experimental features.
-
-.. code-block:: bash
-
-  $ clang++ test.cpp -lc++experimental
+Libc++ provides implementations of some experimental features. Experimental features
+are either Technical Specifications (TSes) or official features that were voted to
+the Standard but whose implementation is not complete or stable yet in libc++. Those
+are disabled by default because they are neither API nor ABI stable. However, the
+``_LIBCPP_ENABLE_EXPERIMENTAL`` macro can be defined to turn those features on. Note
+that you will also need to link to the appropriate ``libc++experimental.a`` static
+archive.
 
 .. warning::
   Experimental libraries are Experimental.
-    * The contents of the ``<experimental/...>`` headers and ``libc++experimental.a``
+    * The contents of the ``<experimental/...>`` headers and the associated static
       library will not remain compatible between versions.
     * No guarantees of API or ABI stability are provided.
     * When the standardized version of an experimental feature is implemented,
index 28436fbf38f4b08316b1825be60f9bd21b5553d9..10123074f83e3ba3045eb08215784769f5ed9b51 100644 (file)
@@ -315,31 +315,30 @@ endif()
 # Add a meta-target for both libraries.
 add_custom_target(cxx DEPENDS ${LIBCXX_BUILD_TARGETS})
 
-if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
-  set(LIBCXX_EXPERIMENTAL_SOURCES
-    experimental/memory_resource.cpp
-    )
-  add_library(cxx_experimental STATIC ${LIBCXX_EXPERIMENTAL_SOURCES})
-  if (LIBCXX_ENABLE_SHARED)
-    target_link_libraries(cxx_experimental PRIVATE cxx_shared)
-  else()
-    target_link_libraries(cxx_experimental PRIVATE cxx_static)
-  endif()
-
-  set_target_properties(cxx_experimental
-    PROPERTIES
-      COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
-      OUTPUT_NAME   "c++experimental"
+set(LIBCXX_EXPERIMENTAL_SOURCES
+  experimental/memory_resource.cpp
   )
-  cxx_add_common_build_flags(cxx_experimental)
 
-  if (LIBCXX_HERMETIC_STATIC_LIBRARY)
-    # _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS can be defined in __config_site
-    # too. Define it in the same way here, to avoid redefinition conflicts.
-    target_compile_definitions(cxx_experimental PRIVATE _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS=)
-  endif()
+add_library(cxx_experimental STATIC ${LIBCXX_EXPERIMENTAL_SOURCES})
+if (LIBCXX_ENABLE_SHARED)
+  target_link_libraries(cxx_experimental PRIVATE cxx_shared)
+else()
+  target_link_libraries(cxx_experimental PRIVATE cxx_static)
 endif()
 
+if (LIBCXX_HERMETIC_STATIC_LIBRARY)
+  # _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS can be defined in __config_site
+  # too. Define it in the same way here, to avoid redefinition conflicts.
+  target_compile_definitions(cxx_experimental PRIVATE _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS=)
+endif()
+
+set_target_properties(cxx_experimental
+  PROPERTIES
+    COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
+    OUTPUT_NAME   "c++experimental"
+)
+cxx_add_common_build_flags(cxx_experimental)
+
 
 if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY)
   set(LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES
@@ -375,7 +374,7 @@ if (LIBCXX_INSTALL_STATIC_LIBRARY)
     RUNTIME DESTINATION ${LIBCXX_INSTALL_RUNTIME_DIR} COMPONENT cxx)
 endif()
 
-if(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY)
+if (LIBCXX_INSTALL_LIBRARY)
   install(TARGETS cxx_experimental
     LIBRARY DESTINATION ${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
     ARCHIVE DESTINATION ${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
@@ -392,10 +391,7 @@ endif()
 
 if (NOT CMAKE_CONFIGURATION_TYPES)
     if(LIBCXX_INSTALL_LIBRARY)
-      set(lib_install_target cxx)
-    endif()
-    if (LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY)
-      set(experimental_lib_install_target cxx_experimental)
+      set(lib_install_target "cxx;cxx_experimental")
     endif()
     if(LIBCXX_INSTALL_HEADERS)
       set(header_install_target install-cxx-headers)
@@ -405,7 +401,7 @@ if (NOT CMAKE_CONFIGURATION_TYPES)
     endif()
     add_custom_target(install-cxx
                       DEPENDS ${lib_install_target}
-                              ${experimental_lib_install_target}
+                              cxx_experimental
                               ${header_install_target}
                               ${pstl_install_target}
                       COMMAND "${CMAKE_COMMAND}"
@@ -413,7 +409,7 @@ if (NOT CMAKE_CONFIGURATION_TYPES)
                       -P "${LIBCXX_BINARY_DIR}/cmake_install.cmake")
     add_custom_target(install-cxx-stripped
                       DEPENDS ${lib_install_target}
-                              ${experimental_lib_install_target}
+                              cxx_experimental
                               ${header_install_target}
                               ${pstl_install_target}
                       COMMAND "${CMAKE_COMMAND}"
index b85f726fd1c022b781725f8e9f46828b79a0f60a..b06db91536eb251421492b3413ffd7a77c06c046 100644 (file)
@@ -93,10 +93,6 @@ if (NOT LIBCXX_ENABLE_EXCEPTIONS)
   serialize_lit_param(enable_exceptions False)
 endif()
 
-if (NOT LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
-  serialize_lit_param(enable_experimental False)
-endif()
-
 if (NOT LIBCXX_ENABLE_RTTI)
   serialize_lit_param(enable_rtti False)
 endif()
index a3b5eade7d08b6b48af7c9e5f504f7a65789b921..876aa2dad1497a1c18670162d568e99c2ccdffa1 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/memory_resource>
 
 // memory_resource * new_delete_resource()
index 1a99d02ebdba059ec6c91b7ca5c33025493b846e..04748c3b58953a6558f840ccd89cf9b29e695308 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/memory_resource>
 
 // memory_resource * new_delete_resource()
index b3bc2e2e5ee7ab555be746c084cf6275bff6c446..f43ea1bd908d03e4aef1f0cbdf5cfcc076ee8ec8 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/memory_resource>
 
 // template <class T> class polymorphic_allocator
index 60e78124ea061c78273e3cc0104212e6737b5ced..36ee90ba1e570b93e0f3ce3996d1a141d6138a64 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/memory_resource>
 
 // template <class T> class polymorphic_allocator;
index ec281c6ab1d7ed620e3333a91e6ffda5affe69ab..5d1e6bbb27b5b15856d309958655e644d06187c3 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/memory_resource>
 
 // template <class T> class polymorphic_allocator;
index 779c0eb231c64284edcfbebeac7fe719682fa0a6..86fdbf9275ebb8ea67ed0a319c875bf27b91ecaa 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/memory_resource>
 
 // template <class T> class polymorphic_allocator
index d080b059e2f0d17c64d6281e83d98f34af5b8212..6fc77f58428b87e091e4d87b2b620507e44fd0dc 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/memory_resource>
 
 // template <class T> class polymorphic_allocator
index e601758b03270d53ebb80547eb887c22342f1799..a1c3fef4fc954e97aecd71aedc890169b4c1c6d6 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/memory_resource>
 
 // template <class T> class polymorphic_allocator
index 3f002d5aed6c838e7a35c3f78b70b2d17d2e4d3a..346e58186c0a23ef20731d950758e388a200c8d9 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/memory_resource>
 
 // template <class T> class polymorphic_allocator
index 07975fd485c126c7ce38799f7622618f0f9de362..ab9b5d5d81cfe6583f46b98117812ae5059f37c1 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/memory_resource>
 
 // template <class T> class polymorphic_allocator
index e9b203f3592553e98faef562e4b2df3b3b7b726e..61c16bd5b4f6565ceb80e102fac21db3b529fc26 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/memory_resource>
 
 // template <class T> class polymorphic_allocator
index 2a9ca2b39b4b330cc6e407a54469c6f55dc6931d..5f71e4b5eb65088f7530a4e70fb600d134e2f0c4 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <memory_resource>
 
 // template <class T> class polymorphic_allocator
index 4d0b9c90f1cfbe7a9d8afaf5ca95bbe49d4a3913..63d99025a73dbd61fa6e339d342f14593afbfcbf 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/memory_resource>
 
 // template <class T> class polymorphic_allocator
index 288222c45c03c9e14e59f0b108cc067cb6a3fc70..bad36cd470d2dd715a6ef946cbe98bc541822e6b 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/memory_resource>
 
 // template <class T> class polymorphic_allocator
index 6030c132a0b8ee3ed4488d23c1d3226970aa8324..58550fe53068885efb61068f5089a479c5c26355 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/memory_resource>
 
 // template <class T> class polymorphic_allocator
index 2776e16b1d683e699a80b47ca30a3fc0b6de1095..1a8146ce0ca485a73032906cae06709ab34c87c8 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/memory_resource>
 
 // template <class T> class polymorphic_allocator
index 5ca6e812c98cf6be87966d8daa780fb3f4fbb0cb..7ab203401dc430ad7b921fb12cfefe2638453f9a 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/memory_resource>
 
 // template <class T> class polymorphic_allocator
index 34ea9e1b303ce0d90a29b8e4c5475ff1dc0f5275..21e3d01d5862972cfc6c05dbfa56de215e7d185e 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/deque>
 
 // namespace std { namespace experimental { namespace pmr {
index f20d176eccf3b2747b7786cb1d7828cb7ae19a1a..7925f1058c63e1abfdb17b6be4336f2900a77eb6 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/forward_list>
 
 // namespace std { namespace experimental { namespace pmr {
index c4eae679d7e2d5395f94f0b3bb4a4099ce0d4758..d33d132cd8049cbbee72a7a0eee28e364bb8e076 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/list>
 
 // namespace std { namespace experimental { namespace pmr {
index 4998f3e64b6a2ccc307c46350e9526a1c32e794c..5ab24e794fb1eeafe118543f2f4f83eed3009288 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/map>
 
 // namespace std { namespace experimental { namespace pmr {
index eb30b202d9d57840e4720c7ca14a8660ca9a8405..8079840a46bb1109677879eda21bfc0dfe115748 100644 (file)
@@ -9,6 +9,11 @@
 // UNSUPPORTED: c++03
 // UNSUPPORTED: no-localization
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/regex>
 
 // namespace std { namespace experimental { namespace pmr {
index 6c3ba831d96d4d8d61e293e818c070699e12e47e..7539b53184b002cf858e93786d6f260a9e2a8dde 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/set>
 
 // namespace std { namespace experimental { namespace pmr {
index 95cb8e5a8d3dcdfd015aaa686edf22cdb78b54ee..ee141039c451653af947ec91dbb92e93f6b7c1e1 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/string>
 
 // namespace std { namespace experimental { namespace pmr {
index 2087aac4e76c9eb8743355111d6e78d3a8fd31ee..775ebcc0822931c5d67ffbe17b1ad77e77c09d97 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/unordered_map>
 
 // namespace std { namespace experimental { namespace pmr {
index da7ecd9c0d13daa5e137a3327660512a53d34948..7ef0d6f03f28b116933e5e005676987ef92d9d98 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/unordered_set>
 
 // namespace std { namespace experimental { namespace pmr {
index f0b14b87cef62f00d9a71e68bc790e7cfb95384a..8f76c2397477a9f0492b5dd4cb2ffcfc9b7ebc2b 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/vector>
 
 // namespace std { namespace experimental { namespace pmr {
index f91865ef569904c5ef265b69a856b5c9f15b418b..0cad6ca95cdcd7a6d51df4626fb72b70ff359f50 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/memory_resource>
 
 //-----------------------------------------------------------------------------
index 91bf1f5efd918e348ba22638ede22d654bc8507b..d904d5a14558b836b30a5b44760a2b6bd1367a18 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/memory_resource>
 
 // memory_resource * new_delete_resource()
index bdd62484d0759b6ab87a18418e428f0561fdbec3..a08e4f93f0816460f799d702916c249a1e12c6e8 100644 (file)
@@ -8,6 +8,11 @@
 
 // UNSUPPORTED: c++03
 
+// Aligned allocation is required by std::experimental::pmr, but it was not provided
+// before macosx10.13 and as a result we get linker errors when deploying to older than
+// macosx10.13.
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
+
 // <experimental/memory_resource>
 
 // memory_resource * null_memory_resource()
index 81a68467e3e1632c45400d4d02d6c4d3ad09b32e..1de4ad9a208e796c74d90f3ee2f5317374605c51 100755 (executable)
@@ -105,7 +105,6 @@ function generate-cmake-libcxx-win() {
     # -D_LIBCPP_HAS_NO_INT128 (both when building the library itself and
     # when building tests) to allow enabling filesystem for running tests,
     # even if it uses a non-permanent ABI.
-
     generate-cmake-base \
           -DLLVM_ENABLE_RUNTIMES="libcxx" \
           -DCMAKE_C_COMPILER=clang-cl \
@@ -523,7 +522,7 @@ clang-cl-dll)
     # correctly when libc++ visibility attributes indicate dllimport linkage
     # anyway), thus just disable the experimental library. Remove this
     # setting when cmake and the test driver does the right thing automatically.
-    generate-cmake-libcxx-win -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF
+    generate-cmake-libcxx-win -DLIBCXX_TEST_PARAMS="enable_experimental=False"
     echo "+++ Running the libc++ tests"
     ${NINJA} -vC "${BUILD_DIR}" check-cxx
 ;;
index dcfefeced957b00d58f5b810ee290427e71c3db9..22aa19ec0a26ca3dc979d91ca4dd7cdfcd3fd78f 100644 (file)
@@ -156,15 +156,19 @@ DEFAULT_PARAMETERS = [
             ])),
 
   Parameter(name='enable_experimental', choices=[True, False], type=bool, default=True,
-            help="Whether to enable tests for experimental C++ libraries (typically Library Fundamentals TSes).",
+            help="Whether to enable tests for experimental C++ Library features.",
             actions=lambda experimental: [] if not experimental else [
-              AddFeature('c++experimental'),
               # When linking in MSVC mode via the Clang driver, a -l<foo>
               # maps to <foo>.lib, so we need to use -llibc++experimental here
               # to make it link against the static libc++experimental.lib.
               # We can't check for the feature 'msvc' in available_features
               # as those features are added after processing parameters.
-              PrependLinkFlag(lambda config: '-llibc++experimental' if _isMSVC(config) else '-lc++experimental')
+              #
+              # TODO: Switch to using the appropriate experimental compiler flag once
+              #       all compilers we support implement that flag.
+              AddFeature('c++experimental'),
+              PrependLinkFlag(lambda cfg: '-llibc++experimental' if _isMSVC(cfg) else '-lc++experimental'),
+              AddCompileFlag('-D_LIBCPP_ENABLE_EXPERIMENTAL'),
             ]),
 
   Parameter(name='long_tests', choices=[True, False], type=bool, default=True,