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

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