255 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// WARNING: This test was generated by generate_feature_test_macro_components.py10// and should not be edited manually.11 12// <numeric>13 14// Test the feature test macros defined by <numeric>15 16// clang-format off17 18#include <numeric>19#include "test_macros.h"20 21#if TEST_STD_VER < 1422 23# ifdef __cpp_lib_constexpr_numeric24# error "__cpp_lib_constexpr_numeric should not be defined before c++20"25# endif26 27# ifdef __cpp_lib_gcd_lcm28# error "__cpp_lib_gcd_lcm should not be defined before c++17"29# endif30 31# ifdef __cpp_lib_interpolate32# error "__cpp_lib_interpolate should not be defined before c++20"33# endif34 35# ifdef __cpp_lib_parallel_algorithm36# error "__cpp_lib_parallel_algorithm should not be defined before c++17"37# endif38 39# ifdef __cpp_lib_ranges_iota40# error "__cpp_lib_ranges_iota should not be defined before c++23"41# endif42 43# ifdef __cpp_lib_saturation_arithmetic44# error "__cpp_lib_saturation_arithmetic should not be defined before c++26"45# endif46 47#elif TEST_STD_VER == 1448 49# ifdef __cpp_lib_constexpr_numeric50# error "__cpp_lib_constexpr_numeric should not be defined before c++20"51# endif52 53# ifdef __cpp_lib_gcd_lcm54# error "__cpp_lib_gcd_lcm should not be defined before c++17"55# endif56 57# ifdef __cpp_lib_interpolate58# error "__cpp_lib_interpolate should not be defined before c++20"59# endif60 61# ifdef __cpp_lib_parallel_algorithm62# error "__cpp_lib_parallel_algorithm should not be defined before c++17"63# endif64 65# ifdef __cpp_lib_ranges_iota66# error "__cpp_lib_ranges_iota should not be defined before c++23"67# endif68 69# ifdef __cpp_lib_saturation_arithmetic70# error "__cpp_lib_saturation_arithmetic should not be defined before c++26"71# endif72 73#elif TEST_STD_VER == 1774 75# ifdef __cpp_lib_constexpr_numeric76# error "__cpp_lib_constexpr_numeric should not be defined before c++20"77# endif78 79# ifndef __cpp_lib_gcd_lcm80# error "__cpp_lib_gcd_lcm should be defined in c++17"81# endif82# if __cpp_lib_gcd_lcm != 201606L83# error "__cpp_lib_gcd_lcm should have the value 201606L in c++17"84# endif85 86# ifdef __cpp_lib_interpolate87# error "__cpp_lib_interpolate should not be defined before c++20"88# endif89 90# if !defined(_LIBCPP_VERSION)91# ifndef __cpp_lib_parallel_algorithm92# error "__cpp_lib_parallel_algorithm should be defined in c++17"93# endif94# if __cpp_lib_parallel_algorithm != 201603L95# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++17"96# endif97# else98# ifdef __cpp_lib_parallel_algorithm99# error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"100# endif101# endif102 103# ifdef __cpp_lib_ranges_iota104# error "__cpp_lib_ranges_iota should not be defined before c++23"105# endif106 107# ifdef __cpp_lib_saturation_arithmetic108# error "__cpp_lib_saturation_arithmetic should not be defined before c++26"109# endif110 111#elif TEST_STD_VER == 20112 113# ifndef __cpp_lib_constexpr_numeric114# error "__cpp_lib_constexpr_numeric should be defined in c++20"115# endif116# if __cpp_lib_constexpr_numeric != 201911L117# error "__cpp_lib_constexpr_numeric should have the value 201911L in c++20"118# endif119 120# ifndef __cpp_lib_gcd_lcm121# error "__cpp_lib_gcd_lcm should be defined in c++20"122# endif123# if __cpp_lib_gcd_lcm != 201606L124# error "__cpp_lib_gcd_lcm should have the value 201606L in c++20"125# endif126 127# ifndef __cpp_lib_interpolate128# error "__cpp_lib_interpolate should be defined in c++20"129# endif130# if __cpp_lib_interpolate != 201902L131# error "__cpp_lib_interpolate should have the value 201902L in c++20"132# endif133 134# if !defined(_LIBCPP_VERSION)135# ifndef __cpp_lib_parallel_algorithm136# error "__cpp_lib_parallel_algorithm should be defined in c++20"137# endif138# if __cpp_lib_parallel_algorithm != 201603L139# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++20"140# endif141# else142# ifdef __cpp_lib_parallel_algorithm143# error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"144# endif145# endif146 147# ifdef __cpp_lib_ranges_iota148# error "__cpp_lib_ranges_iota should not be defined before c++23"149# endif150 151# ifdef __cpp_lib_saturation_arithmetic152# error "__cpp_lib_saturation_arithmetic should not be defined before c++26"153# endif154 155#elif TEST_STD_VER == 23156 157# ifndef __cpp_lib_constexpr_numeric158# error "__cpp_lib_constexpr_numeric should be defined in c++23"159# endif160# if __cpp_lib_constexpr_numeric != 201911L161# error "__cpp_lib_constexpr_numeric should have the value 201911L in c++23"162# endif163 164# ifndef __cpp_lib_gcd_lcm165# error "__cpp_lib_gcd_lcm should be defined in c++23"166# endif167# if __cpp_lib_gcd_lcm != 201606L168# error "__cpp_lib_gcd_lcm should have the value 201606L in c++23"169# endif170 171# ifndef __cpp_lib_interpolate172# error "__cpp_lib_interpolate should be defined in c++23"173# endif174# if __cpp_lib_interpolate != 201902L175# error "__cpp_lib_interpolate should have the value 201902L in c++23"176# endif177 178# if !defined(_LIBCPP_VERSION)179# ifndef __cpp_lib_parallel_algorithm180# error "__cpp_lib_parallel_algorithm should be defined in c++23"181# endif182# if __cpp_lib_parallel_algorithm != 201603L183# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++23"184# endif185# else186# ifdef __cpp_lib_parallel_algorithm187# error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"188# endif189# endif190 191# ifndef __cpp_lib_ranges_iota192# error "__cpp_lib_ranges_iota should be defined in c++23"193# endif194# if __cpp_lib_ranges_iota != 202202L195# error "__cpp_lib_ranges_iota should have the value 202202L in c++23"196# endif197 198# ifdef __cpp_lib_saturation_arithmetic199# error "__cpp_lib_saturation_arithmetic should not be defined before c++26"200# endif201 202#elif TEST_STD_VER > 23203 204# ifndef __cpp_lib_constexpr_numeric205# error "__cpp_lib_constexpr_numeric should be defined in c++26"206# endif207# if __cpp_lib_constexpr_numeric != 201911L208# error "__cpp_lib_constexpr_numeric should have the value 201911L in c++26"209# endif210 211# ifndef __cpp_lib_gcd_lcm212# error "__cpp_lib_gcd_lcm should be defined in c++26"213# endif214# if __cpp_lib_gcd_lcm != 201606L215# error "__cpp_lib_gcd_lcm should have the value 201606L in c++26"216# endif217 218# ifndef __cpp_lib_interpolate219# error "__cpp_lib_interpolate should be defined in c++26"220# endif221# if __cpp_lib_interpolate != 201902L222# error "__cpp_lib_interpolate should have the value 201902L in c++26"223# endif224 225# if !defined(_LIBCPP_VERSION)226# ifndef __cpp_lib_parallel_algorithm227# error "__cpp_lib_parallel_algorithm should be defined in c++26"228# endif229# if __cpp_lib_parallel_algorithm != 201603L230# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++26"231# endif232# else233# ifdef __cpp_lib_parallel_algorithm234# error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"235# endif236# endif237 238# ifndef __cpp_lib_ranges_iota239# error "__cpp_lib_ranges_iota should be defined in c++26"240# endif241# if __cpp_lib_ranges_iota != 202202L242# error "__cpp_lib_ranges_iota should have the value 202202L in c++26"243# endif244 245# ifndef __cpp_lib_saturation_arithmetic246# error "__cpp_lib_saturation_arithmetic should be defined in c++26"247# endif248# if __cpp_lib_saturation_arithmetic != 202311L249# error "__cpp_lib_saturation_arithmetic should have the value 202311L in c++26"250# endif251 252#endif // TEST_STD_VER > 23253 254// clang-format on255