[llvm-branch-commits] [libcxx] [libc++] Adds a FTM v2 data file generator. (PR #134555)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Apr 6 10:57:18 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Mark de Wever (mordante)

<details>
<summary>Changes</summary>

This generator converts the existing data structure to the new JSON format. Next to adding the generator add the output of the tests in a new directory beneath the existing directory. This allows validating the output for the old and new tests. (These should be almost identical.)

This infrastructure allows using the new code and developing additional features without changing the existing work-flow. Then at some point we can switch from the old to the new version without a lot of additional manual work or merge conflicts.

The new files are generated by the normal libcxx-generate-files cmake target that is used to update the existing FTM macros.

Note the new code have no tests; the validation of the output and testing in the CI shows it works. This code will be removed in the future.

---

Patch is 556.20 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/134555.diff


84 Files Affected:

- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/algorithm.version.compile.pass.cpp (+463) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/any.version.compile.pass.cpp (+73) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/array.version.compile.pass.cpp (+175) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/atomic.version.compile.pass.cpp (+424) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/barrier.version.compile.pass.cpp (+90) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/bit.version.compile.pass.cpp (+199) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/bitset.version.compile.pass.cpp (+94) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/charconv.version.compile.pass.cpp (+127) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/chrono.version.compile.pass.cpp (+112) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/cmath.version.compile.pass.cpp (+208) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/compare.version.compile.pass.cpp (+70) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/complex.version.compile.pass.cpp (+109) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/concepts.version.compile.pass.cpp (+70) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/coroutine.version.compile.pass.cpp (+70) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/cstddef.version.compile.pass.cpp (+73) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/cstdlib.version.compile.pass.cpp (+81) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/cstring.version.compile.pass.cpp (+72) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/debugging.version.compile.pass.cpp (+72) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/deque.version.compile.pass.cpp (+205) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/exception.version.compile.pass.cpp (+73) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/execution.version.compile.pass.cpp (+132) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/expected.version.compile.pass.cpp (+100) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/filesystem.version.compile.pass.cpp (+183) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/flat_map.version.compile.pass.cpp (+67) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/flat_set.version.compile.pass.cpp (+81) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/format.version.compile.pass.cpp (+151) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/forward_list.version.compile.pass.cpp (+274) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/fstream.version.compile.pass.cpp (+72) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/functional.version.compile.pass.cpp (+550) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/hazard_pointer.version.compile.pass.cpp (+72) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/inplace_vector.version.compile.pass.cpp (+72) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/iomanip.version.compile.pass.cpp (+108) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/ios.version.compile.pass.cpp (+69) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/istream.version.compile.pass.cpp (+90) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/iterator.version.compile.pass.cpp (+319) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/latch.version.compile.pass.cpp (+90) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/limits.version.compile.pass.cpp (+88) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/linalg.version.compile.pass.cpp (+72) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/list.version.compile.pass.cpp (+274) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/locale.version.compile.pass.cpp (+90) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/map.version.compile.pass.cpp (+400) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/mdspan.version.compile.pass.cpp (+133) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/memory.version.compile.pass.cpp (+655) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/memory_resource.version.compile.pass.cpp (+148) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/mutex.version.compile.pass.cpp (+99) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/new.version.compile.pass.cpp (+217) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/numbers.version.compile.pass.cpp (+70) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/numeric.version.compile.pass.cpp (+268) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/optional.version.compile.pass.cpp (+172) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/ostream.version.compile.pass.cpp (+132) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/print.version.compile.pass.cpp (+81) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/queue.version.compile.pass.cpp (+97) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/random.version.compile.pass.cpp (+105) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/ranges.version.compile.pass.cpp (+466) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/ratio.version.compile.pass.cpp (+64) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/rcu.version.compile.pass.cpp (+72) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/regex.version.compile.pass.cpp (+75) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/scoped_allocator.version.compile.pass.cpp (+73) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/semaphore.version.compile.pass.cpp (+90) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/set.version.compile.pass.cpp (+322) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/shared_mutex.version.compile.pass.cpp (+168) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/source_location.version.compile.pass.cpp (+70) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/span.version.compile.pass.cpp (+124) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/spanstream.version.compile.pass.cpp (+81) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/sstream.version.compile.pass.cpp (+66) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/stack.version.compile.pass.cpp (+97) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/stacktrace.version.compile.pass.cpp (+123) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/stdatomic.h.version.compile.pass.cpp (+69) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/stop_token.version.compile.pass.cpp (+90) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/string.version.compile.pass.cpp (+490) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/string_view.version.compile.pass.cpp (+253) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/syncstream.version.compile.pass.cpp (+90) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/text_encoding.version.compile.pass.cpp (+72) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/thread.version.compile.pass.cpp (+132) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/tuple.version.compile.pass.cpp (+337) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/type_traits.version.compile.pass.cpp (+967) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/typeinfo.version.compile.pass.cpp (+67) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/unordered_map.version.compile.pass.cpp (+394) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/unordered_set.version.compile.pass.cpp (+316) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/utility.version.compile.pass.cpp (+496) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/variant.version.compile.pass.cpp (+139) 
- (added) libcxx/test/std/language.support/support.limits/support.limits.general/v2/vector.version.compile.pass.cpp (+274) 
- (added) libcxx/utils/data/feature_test_macro/data.json (+3000) 
- (modified) libcxx/utils/generate_feature_test_macro_components.py (+82-1) 


``````````diff
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/algorithm.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/algorithm.version.compile.pass.cpp
new file mode 100644
index 0000000000000..2aa0ad30abfe7
--- /dev/null
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/algorithm.version.compile.pass.cpp
@@ -0,0 +1,463 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// WARNING: This test was generated by
+// generate_feature_test_macro_components.py
+// and should not be edited manually.
+
+// <algorithm>
+
+// Test the feature test macros defined by <algorithm>
+
+// clang-format off
+
+#include <algorithm>
+#include "test_macros.h"
+
+#if TEST_STD_VER < 14
+
+#  ifdef __cpp_lib_clamp
+#    error "__cpp_lib_clamp should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_algorithm
+#    error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_parallel_algorithm
+#    error "__cpp_lib_parallel_algorithm should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_ranges_contains
+#    error "__cpp_lib_ranges_contains should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_find_last
+#    error "__cpp_lib_ranges_find_last should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_starts_ends_with
+#    error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_robust_nonmodifying_seq_ops
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should not be defined before c++14"
+#  endif
+
+#  ifdef __cpp_lib_sample
+#    error "__cpp_lib_sample should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_shift
+#    error "__cpp_lib_shift should not be defined before c++20"
+#  endif
+
+#elif TEST_STD_VER == 14
+
+#  ifdef __cpp_lib_clamp
+#    error "__cpp_lib_clamp should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_algorithm
+#    error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_parallel_algorithm
+#    error "__cpp_lib_parallel_algorithm should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_ranges_contains
+#    error "__cpp_lib_ranges_contains should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_find_last
+#    error "__cpp_lib_ranges_find_last should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_starts_ends_with
+#    error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_robust_nonmodifying_seq_ops
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++14"
+#  endif
+#  if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++14"
+#  endif
+
+#  ifdef __cpp_lib_sample
+#    error "__cpp_lib_sample should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_shift
+#    error "__cpp_lib_shift should not be defined before c++20"
+#  endif
+
+#elif TEST_STD_VER == 17
+
+#  ifndef __cpp_lib_clamp
+#    error "__cpp_lib_clamp should be defined in c++17"
+#  endif
+#  if __cpp_lib_clamp != 201603L
+#    error "__cpp_lib_clamp should have the value 201603L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_algorithm
+#    error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should be defined in c++17"
+#    endif
+#    if __cpp_lib_parallel_algorithm != 201603L
+#      error "__cpp_lib_parallel_algorithm should have the value 201603L in c++17"
+#    endif
+#  else
+#    ifdef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifdef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should not be defined before c++20"
+#  endif
+
+#  ifdef __cpp_lib_ranges_contains
+#    error "__cpp_lib_ranges_contains should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_find_last
+#    error "__cpp_lib_ranges_find_last should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_starts_ends_with
+#    error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_robust_nonmodifying_seq_ops
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++17"
+#  endif
+#  if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++17"
+#  endif
+
+#  ifndef __cpp_lib_sample
+#    error "__cpp_lib_sample should be defined in c++17"
+#  endif
+#  if __cpp_lib_sample != 201603L
+#    error "__cpp_lib_sample should have the value 201603L in c++17"
+#  endif
+
+#  ifdef __cpp_lib_shift
+#    error "__cpp_lib_shift should not be defined before c++20"
+#  endif
+
+#elif TEST_STD_VER == 20
+
+#  ifndef __cpp_lib_clamp
+#    error "__cpp_lib_clamp should be defined in c++20"
+#  endif
+#  if __cpp_lib_clamp != 201603L
+#    error "__cpp_lib_clamp should have the value 201603L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should be defined in c++20"
+#  endif
+#  if __cpp_lib_constexpr_algorithms != 201806L
+#    error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_algorithm
+#    error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should be defined in c++20"
+#    endif
+#    if __cpp_lib_parallel_algorithm != 201603L
+#      error "__cpp_lib_parallel_algorithm should have the value 201603L in c++20"
+#    endif
+#  else
+#    ifdef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++20"
+#  endif
+#  if __cpp_lib_ranges != 202110L
+#    error "__cpp_lib_ranges should have the value 202110L in c++20"
+#  endif
+
+#  ifdef __cpp_lib_ranges_contains
+#    error "__cpp_lib_ranges_contains should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_find_last
+#    error "__cpp_lib_ranges_find_last should not be defined before c++23"
+#  endif
+
+#  ifdef __cpp_lib_ranges_starts_ends_with
+#    error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23"
+#  endif
+
+#  ifndef __cpp_lib_robust_nonmodifying_seq_ops
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++20"
+#  endif
+#  if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_sample
+#    error "__cpp_lib_sample should be defined in c++20"
+#  endif
+#  if __cpp_lib_sample != 201603L
+#    error "__cpp_lib_sample should have the value 201603L in c++20"
+#  endif
+
+#  ifndef __cpp_lib_shift
+#    error "__cpp_lib_shift should be defined in c++20"
+#  endif
+#  if __cpp_lib_shift != 201806L
+#    error "__cpp_lib_shift should have the value 201806L in c++20"
+#  endif
+
+#elif TEST_STD_VER == 23
+
+#  ifndef __cpp_lib_clamp
+#    error "__cpp_lib_clamp should be defined in c++23"
+#  endif
+#  if __cpp_lib_clamp != 201603L
+#    error "__cpp_lib_clamp should have the value 201603L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should be defined in c++23"
+#  endif
+#  if __cpp_lib_constexpr_algorithms != 201806L
+#    error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++23"
+#  endif
+
+#  ifdef __cpp_lib_default_template_type_for_algorithm_values
+#    error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_algorithm
+#    error "__cpp_lib_freestanding_algorithm should not be defined before c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should be defined in c++23"
+#    endif
+#    if __cpp_lib_parallel_algorithm != 201603L
+#      error "__cpp_lib_parallel_algorithm should have the value 201603L in c++23"
+#    endif
+#  else
+#    ifdef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges != 202406L
+#    error "__cpp_lib_ranges should have the value 202406L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_ranges_contains
+#    error "__cpp_lib_ranges_contains should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges_contains != 202207L
+#    error "__cpp_lib_ranges_contains should have the value 202207L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_ranges_find_last
+#    error "__cpp_lib_ranges_find_last should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges_find_last != 202207L
+#    error "__cpp_lib_ranges_find_last should have the value 202207L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_ranges_starts_ends_with
+#    error "__cpp_lib_ranges_starts_ends_with should be defined in c++23"
+#  endif
+#  if __cpp_lib_ranges_starts_ends_with != 202106L
+#    error "__cpp_lib_ranges_starts_ends_with should have the value 202106L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_robust_nonmodifying_seq_ops
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++23"
+#  endif
+#  if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_sample
+#    error "__cpp_lib_sample should be defined in c++23"
+#  endif
+#  if __cpp_lib_sample != 201603L
+#    error "__cpp_lib_sample should have the value 201603L in c++23"
+#  endif
+
+#  ifndef __cpp_lib_shift
+#    error "__cpp_lib_shift should be defined in c++23"
+#  endif
+#  if __cpp_lib_shift != 201806L
+#    error "__cpp_lib_shift should have the value 201806L in c++23"
+#  endif
+
+#elif TEST_STD_VER > 23
+
+#  ifndef __cpp_lib_clamp
+#    error "__cpp_lib_clamp should be defined in c++26"
+#  endif
+#  if __cpp_lib_clamp != 201603L
+#    error "__cpp_lib_clamp should have the value 201603L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_constexpr_algorithms
+#    error "__cpp_lib_constexpr_algorithms should be defined in c++26"
+#  endif
+#  if __cpp_lib_constexpr_algorithms != 202306L
+#    error "__cpp_lib_constexpr_algorithms should have the value 202306L in c++26"
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_default_template_type_for_algorithm_values
+#      error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26"
+#    endif
+#    if __cpp_lib_default_template_type_for_algorithm_values != 202403L
+#      error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_default_template_type_for_algorithm_values
+#      error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_freestanding_algorithm
+#      error "__cpp_lib_freestanding_algorithm should be defined in c++26"
+#    endif
+#    if __cpp_lib_freestanding_algorithm != 202311L
+#      error "__cpp_lib_freestanding_algorithm should have the value 202311L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_freestanding_algorithm
+#      error "__cpp_lib_freestanding_algorithm should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  if !defined(_LIBCPP_VERSION)
+#    ifndef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should be defined in c++26"
+#    endif
+#    if __cpp_lib_parallel_algorithm != 201603L
+#      error "__cpp_lib_parallel_algorithm should have the value 201603L in c++26"
+#    endif
+#  else
+#    ifdef __cpp_lib_parallel_algorithm
+#      error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
+#    endif
+#  endif
+
+#  ifndef __cpp_lib_ranges
+#    error "__cpp_lib_ranges should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges != 202406L
+#    error "__cpp_lib_ranges should have the value 202406L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_ranges_contains
+#    error "__cpp_lib_ranges_contains should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges_contains != 202207L
+#    error "__cpp_lib_ranges_contains should have the value 202207L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_ranges_find_last
+#    error "__cpp_lib_ranges_find_last should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges_find_last != 202207L
+#    error "__cpp_lib_ranges_find_last should have the value 202207L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_ranges_starts_ends_with
+#    error "__cpp_lib_ranges_starts_ends_with should be defined in c++26"
+#  endif
+#  if __cpp_lib_ranges_starts_ends_with != 202106L
+#    error "__cpp_lib_ranges_starts_ends_with should have the value 202106L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_robust_nonmodifying_seq_ops
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++26"
+#  endif
+#  if __cpp_lib_robust_nonmodifying_seq_ops != 201304L
+#    error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_sample
+#    error "__cpp_lib_sample should be defined in c++26"
+#  endif
+#  if __cpp_lib_sample != 201603L
+#    error "__cpp_lib_sample should have the value 201603L in c++26"
+#  endif
+
+#  ifndef __cpp_lib_shift
+#    error "__cpp_lib_shift should be defined in c++26"
+#  endif
+#  if __cpp_lib_shift != 201806L
+#    error "__cpp_lib_shift should have the value 201806L in c++26"
+#  endif
+
+#endif // TEST_STD_VER > 23
+
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/any.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/any.version.compile.pass.cpp
new file mode 100644
index 0000000000000..46b66f19cda39
--- /dev/null
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/any.version.compile.pass.cpp
@@ -0,0 +1,73 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// WARNING: This test was generated by
+// generate_feature_test_macro_components.py
+// and should not be edited manually.
+
+// <any>
+
+// Test the feature test macros defined by <any>
+
+// clang-format off
+
+#include <any>
+#include "test_macros.h"
+
+#if TEST_STD_VER < 14
+
+#  ifdef __cpp_lib_any
+#    error "__cpp_lib_any should not be defined before c++17"
+#  endif
+
+#elif TEST_STD_VER == 14
+
+#  ifdef __cpp_lib_any
+#    error "__cpp_lib_any should not be defined before c++17"
+#  endif
+
+#elif TEST_STD_VER == 17
+
+#  ifndef __cpp_lib_any
+#    error "__cpp_lib_any should be defined in c++17"
+#  endif
+#  if __cpp_lib_any != 201606L
+#    error "__cpp_lib_any should have the value 201606L in c++17"
+#  endif
+
+#elif TEST_STD_VER == 20
+
+#  ifndef __cpp_lib_any
+#    error "__cpp_lib_any should be defined in c++20"
+#  endif
+#  if __cpp_lib_any != 201606L
+#    error "__cpp_lib_any should have the value 201606L in c++20"
+#  endif
+
+#elif TEST_STD_VER == 23
+
+#  ifndef __cpp_lib_any
+#    error "__cpp_lib_any should be defined in c++23"
+#  endif
+#  if __cpp_lib_any != 201606L
+#    error "__cpp_lib_any should have the value 201606L in c++23"
+#  endif
+
+#elif TEST_STD_VER > 23
+
+#  ifndef __cpp_lib_any
+#    error "__cpp_lib_any should be defined in c++26"
+#  endif
+#  if __cpp_lib_any != 201606L
+#    error "__cpp_lib_any should have the value 201606L in c++26"
+#  endif
+
+#endif // TEST_STD_VER > 23
+
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/array.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/array.version.compile.pass.cpp
new file mode 100644
index 0000000000000..6992c42530c81
--- /dev/null
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/array.version.compile.pass.cpp
@@ -0,0 +1,175 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// WARNING: This test was generated by
+// generate_feature_test_macro_components.py
+// and should not be edited manually.
+
+// <array>
+
+// Test the feature test macros defined by <array>
+
+// clang-format off
+
+#include <array>
+#include "test_macros.h"
+
+#if TEST_STD_VER < 14
+
+#  ifdef __cpp_lib_array_constexpr
+#    error "__cpp_lib_array_constexpr should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_array
+#    error "__cpp_lib_freestanding_array should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_to_array
+#    error "__cpp_lib_to_array should not be defined before c++20"
+#  endif
+
+#elif TEST_STD_VER == 14
+
+#  ifdef __cpp_lib_array_constexpr
+#    error "__cpp_lib_array_constexpr should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_freestanding_array
+#    error "__cpp_lib_freestanding_array should not be defined before c++26"
+#  endif
+
+#  ifdef __cpp_lib_nonmember_container_access
+#    error "__cpp_lib_nonmember_container_access should not be defined before c++17"
+#  endif
+
+#  ifdef __cpp_lib_to_array
+#  ...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/134555


More information about the llvm-branch-commits mailing list