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-exception
6//
7//===----------------------------------------------------------------------===//
8
9// WARNING: This test was generated by generate_feature_test_macro_components.py
10// and should not be edited manually.
11
12// <limits>
13
14// Test the feature test macros defined by <limits>
15
16// clang-format off
17
18#include <limits>
19#include "test_macros.h"
20
21#if TEST_STD_VER < 14
22
23# ifdef __cpp_lib_char8_t
24# error "__cpp_lib_char8_t should not be defined before c++20"
25# endif
26
27#elif TEST_STD_VER == 14
28
29# ifdef __cpp_lib_char8_t
30# error "__cpp_lib_char8_t should not be defined before c++20"
31# endif
32
33#elif TEST_STD_VER == 17
34
35# ifdef __cpp_lib_char8_t
36# error "__cpp_lib_char8_t should not be defined before c++20"
37# endif
38
39#elif TEST_STD_VER == 20
40
41# if defined(__cpp_char8_t)
42# ifndef __cpp_lib_char8_t
43# error "__cpp_lib_char8_t should be defined in c++20"
44# endif
45# if __cpp_lib_char8_t != 201907L
46# error "__cpp_lib_char8_t should have the value 201907L in c++20"
47# endif
48# else
49# ifdef __cpp_lib_char8_t
50# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
51# endif
52# endif
53
54#elif TEST_STD_VER == 23
55
56# if defined(__cpp_char8_t)
57# ifndef __cpp_lib_char8_t
58# error "__cpp_lib_char8_t should be defined in c++23"
59# endif
60# if __cpp_lib_char8_t != 201907L
61# error "__cpp_lib_char8_t should have the value 201907L in c++23"
62# endif
63# else
64# ifdef __cpp_lib_char8_t
65# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
66# endif
67# endif
68
69#elif TEST_STD_VER > 23
70
71# if defined(__cpp_char8_t)
72# ifndef __cpp_lib_char8_t
73# error "__cpp_lib_char8_t should be defined in c++26"
74# endif
75# if __cpp_lib_char8_t != 201907L
76# error "__cpp_lib_char8_t should have the value 201907L in c++26"
77# endif
78# else
79# ifdef __cpp_lib_char8_t
80# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
81# endif
82# endif
83
84#endif // TEST_STD_VER > 23
85
86// clang-format on
87
88

source code of libcxx/test/std/language.support/support.limits/support.limits.general/limits.version.compile.pass.cpp