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

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