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

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