Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Differential D136522 Diff 516117 libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
Changeset View
Changeset View
Standalone View
Standalone View
libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
Show All 12 Lines | |||||
// <algorithm> | // <algorithm> | ||||
// Test the feature test macros defined by <algorithm> | // Test the feature test macros defined by <algorithm> | ||||
/* Constant Value | /* Constant Value | ||||
__cpp_lib_clamp 201603L [C++17] | __cpp_lib_clamp 201603L [C++17] | ||||
__cpp_lib_constexpr_algorithms 201806L [C++20] | __cpp_lib_constexpr_algorithms 201806L [C++20] | ||||
__cpp_lib_find_last 202207L [C++2b] | |||||
__cpp_lib_parallel_algorithm 201603L [C++17] | __cpp_lib_parallel_algorithm 201603L [C++17] | ||||
__cpp_lib_ranges 202106L [C++20] | __cpp_lib_ranges 202106L [C++20] | ||||
__cpp_lib_ranges_starts_ends_with 202106L [C++2b] | __cpp_lib_ranges_starts_ends_with 202106L [C++2b] | ||||
__cpp_lib_robust_nonmodifying_seq_ops 201304L [C++14] | __cpp_lib_robust_nonmodifying_seq_ops 201304L [C++14] | ||||
__cpp_lib_sample 201603L [C++17] | __cpp_lib_sample 201603L [C++17] | ||||
__cpp_lib_shift 201806L [C++20] | __cpp_lib_shift 201806L [C++20] | ||||
*/ | */ | ||||
#include <algorithm> | #include <algorithm> | ||||
#include "test_macros.h" | #include "test_macros.h" | ||||
#if TEST_STD_VER < 14 | #if TEST_STD_VER < 14 | ||||
# ifdef __cpp_lib_clamp | # ifdef __cpp_lib_clamp | ||||
# error "__cpp_lib_clamp should not be defined before c++17" | # error "__cpp_lib_clamp should not be defined before c++17" | ||||
# endif | # endif | ||||
# ifdef __cpp_lib_constexpr_algorithms | # ifdef __cpp_lib_constexpr_algorithms | ||||
# error "__cpp_lib_constexpr_algorithms should not be defined before c++20" | # error "__cpp_lib_constexpr_algorithms should not be defined before c++20" | ||||
# endif | # endif | ||||
# ifdef __cpp_lib_find_last | |||||
# error "__cpp_lib_find_last should not be defined before c++2b" | |||||
# endif | |||||
# ifdef __cpp_lib_parallel_algorithm | # ifdef __cpp_lib_parallel_algorithm | ||||
# error "__cpp_lib_parallel_algorithm should not be defined before c++17" | # error "__cpp_lib_parallel_algorithm should not be defined before c++17" | ||||
# endif | # endif | ||||
# ifdef __cpp_lib_ranges | # ifdef __cpp_lib_ranges | ||||
# error "__cpp_lib_ranges should not be defined before c++20" | # error "__cpp_lib_ranges should not be defined before c++20" | ||||
# endif | # endif | ||||
Show All 18 Lines | |||||
# ifdef __cpp_lib_clamp | # ifdef __cpp_lib_clamp | ||||
# error "__cpp_lib_clamp should not be defined before c++17" | # error "__cpp_lib_clamp should not be defined before c++17" | ||||
# endif | # endif | ||||
# ifdef __cpp_lib_constexpr_algorithms | # ifdef __cpp_lib_constexpr_algorithms | ||||
# error "__cpp_lib_constexpr_algorithms should not be defined before c++20" | # error "__cpp_lib_constexpr_algorithms should not be defined before c++20" | ||||
# endif | # endif | ||||
# ifdef __cpp_lib_find_last | |||||
# error "__cpp_lib_find_last should not be defined before c++2b" | |||||
# endif | |||||
# ifdef __cpp_lib_parallel_algorithm | # ifdef __cpp_lib_parallel_algorithm | ||||
# error "__cpp_lib_parallel_algorithm should not be defined before c++17" | # error "__cpp_lib_parallel_algorithm should not be defined before c++17" | ||||
# endif | # endif | ||||
# ifdef __cpp_lib_ranges | # ifdef __cpp_lib_ranges | ||||
# error "__cpp_lib_ranges should not be defined before c++20" | # error "__cpp_lib_ranges should not be defined before c++20" | ||||
# endif | # endif | ||||
Show All 24 Lines | |||||
# if __cpp_lib_clamp != 201603L | # if __cpp_lib_clamp != 201603L | ||||
# error "__cpp_lib_clamp should have the value 201603L in c++17" | # error "__cpp_lib_clamp should have the value 201603L in c++17" | ||||
# endif | # endif | ||||
# ifdef __cpp_lib_constexpr_algorithms | # ifdef __cpp_lib_constexpr_algorithms | ||||
# error "__cpp_lib_constexpr_algorithms should not be defined before c++20" | # error "__cpp_lib_constexpr_algorithms should not be defined before c++20" | ||||
# endif | # endif | ||||
# ifdef __cpp_lib_find_last | |||||
# error "__cpp_lib_find_last should not be defined before c++2b" | |||||
# endif | |||||
# if !defined(_LIBCPP_VERSION) | # if !defined(_LIBCPP_VERSION) | ||||
# ifndef __cpp_lib_parallel_algorithm | # ifndef __cpp_lib_parallel_algorithm | ||||
# error "__cpp_lib_parallel_algorithm should be defined in c++17" | # error "__cpp_lib_parallel_algorithm should be defined in c++17" | ||||
# endif | # endif | ||||
# if __cpp_lib_parallel_algorithm != 201603L | # if __cpp_lib_parallel_algorithm != 201603L | ||||
# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++17" | # error "__cpp_lib_parallel_algorithm should have the value 201603L in c++17" | ||||
# endif | # endif | ||||
# else // _LIBCPP_VERSION | # else // _LIBCPP_VERSION | ||||
Show All 39 Lines | |||||
# ifndef __cpp_lib_constexpr_algorithms | # ifndef __cpp_lib_constexpr_algorithms | ||||
# error "__cpp_lib_constexpr_algorithms should be defined in c++20" | # error "__cpp_lib_constexpr_algorithms should be defined in c++20" | ||||
# endif | # endif | ||||
# if __cpp_lib_constexpr_algorithms != 201806L | # if __cpp_lib_constexpr_algorithms != 201806L | ||||
# error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++20" | # error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++20" | ||||
# endif | # endif | ||||
# ifdef __cpp_lib_find_last | |||||
# error "__cpp_lib_find_last should not be defined before c++2b" | |||||
# endif | |||||
# if !defined(_LIBCPP_VERSION) | # if !defined(_LIBCPP_VERSION) | ||||
# ifndef __cpp_lib_parallel_algorithm | # ifndef __cpp_lib_parallel_algorithm | ||||
# error "__cpp_lib_parallel_algorithm should be defined in c++20" | # error "__cpp_lib_parallel_algorithm should be defined in c++20" | ||||
# endif | # endif | ||||
# if __cpp_lib_parallel_algorithm != 201603L | # if __cpp_lib_parallel_algorithm != 201603L | ||||
# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++20" | # error "__cpp_lib_parallel_algorithm should have the value 201603L in c++20" | ||||
# endif | # endif | ||||
# else // _LIBCPP_VERSION | # else // _LIBCPP_VERSION | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
# ifndef __cpp_lib_constexpr_algorithms | # ifndef __cpp_lib_constexpr_algorithms | ||||
# error "__cpp_lib_constexpr_algorithms should be defined in c++2b" | # error "__cpp_lib_constexpr_algorithms should be defined in c++2b" | ||||
# endif | # endif | ||||
# if __cpp_lib_constexpr_algorithms != 201806L | # if __cpp_lib_constexpr_algorithms != 201806L | ||||
# error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++2b" | # error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++2b" | ||||
# endif | # endif | ||||
# ifndef __cpp_lib_find_last | |||||
# error "__cpp_lib_find_last should be defined in c++2b" | |||||
# endif | |||||
# if __cpp_lib_find_last != 202207L | |||||
# error "__cpp_lib_find_last should have the value 202207L in c++2b" | |||||
# endif | |||||
# if !defined(_LIBCPP_VERSION) | # if !defined(_LIBCPP_VERSION) | ||||
# ifndef __cpp_lib_parallel_algorithm | # ifndef __cpp_lib_parallel_algorithm | ||||
# error "__cpp_lib_parallel_algorithm should be defined in c++2b" | # error "__cpp_lib_parallel_algorithm should be defined in c++2b" | ||||
# endif | # endif | ||||
# if __cpp_lib_parallel_algorithm != 201603L | # if __cpp_lib_parallel_algorithm != 201603L | ||||
# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++2b" | # error "__cpp_lib_parallel_algorithm should have the value 201603L in c++2b" | ||||
# endif | # endif | ||||
# else // _LIBCPP_VERSION | # else // _LIBCPP_VERSION | ||||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |