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 | // <mdspan> |
15 | |
16 | // Test the feature test macros defined by <mdspan> |
17 | |
18 | /* Constant Value |
19 | __cpp_lib_freestanding_mdspan 202311L [C++26] |
20 | __cpp_lib_mdspan 202207L [C++23] |
21 | __cpp_lib_submdspan 202306L [C++26] |
22 | */ |
23 | |
24 | #include <mdspan> |
25 | #include "test_macros.h" |
26 | |
27 | #if TEST_STD_VER < 14 |
28 | |
29 | # ifdef __cpp_lib_freestanding_mdspan |
30 | # error "__cpp_lib_freestanding_mdspan should not be defined before c++26" |
31 | # endif |
32 | |
33 | # ifdef __cpp_lib_mdspan |
34 | # error "__cpp_lib_mdspan should not be defined before c++23" |
35 | # endif |
36 | |
37 | # ifdef __cpp_lib_submdspan |
38 | # error "__cpp_lib_submdspan should not be defined before c++26" |
39 | # endif |
40 | |
41 | #elif TEST_STD_VER == 14 |
42 | |
43 | # ifdef __cpp_lib_freestanding_mdspan |
44 | # error "__cpp_lib_freestanding_mdspan should not be defined before c++26" |
45 | # endif |
46 | |
47 | # ifdef __cpp_lib_mdspan |
48 | # error "__cpp_lib_mdspan should not be defined before c++23" |
49 | # endif |
50 | |
51 | # ifdef __cpp_lib_submdspan |
52 | # error "__cpp_lib_submdspan should not be defined before c++26" |
53 | # endif |
54 | |
55 | #elif TEST_STD_VER == 17 |
56 | |
57 | # ifdef __cpp_lib_freestanding_mdspan |
58 | # error "__cpp_lib_freestanding_mdspan should not be defined before c++26" |
59 | # endif |
60 | |
61 | # ifdef __cpp_lib_mdspan |
62 | # error "__cpp_lib_mdspan should not be defined before c++23" |
63 | # endif |
64 | |
65 | # ifdef __cpp_lib_submdspan |
66 | # error "__cpp_lib_submdspan should not be defined before c++26" |
67 | # endif |
68 | |
69 | #elif TEST_STD_VER == 20 |
70 | |
71 | # ifdef __cpp_lib_freestanding_mdspan |
72 | # error "__cpp_lib_freestanding_mdspan should not be defined before c++26" |
73 | # endif |
74 | |
75 | # ifdef __cpp_lib_mdspan |
76 | # error "__cpp_lib_mdspan should not be defined before c++23" |
77 | # endif |
78 | |
79 | # ifdef __cpp_lib_submdspan |
80 | # error "__cpp_lib_submdspan should not be defined before c++26" |
81 | # endif |
82 | |
83 | #elif TEST_STD_VER == 23 |
84 | |
85 | # ifdef __cpp_lib_freestanding_mdspan |
86 | # error "__cpp_lib_freestanding_mdspan should not be defined before c++26" |
87 | # endif |
88 | |
89 | # ifndef __cpp_lib_mdspan |
90 | # error "__cpp_lib_mdspan should be defined in c++23" |
91 | # endif |
92 | # if __cpp_lib_mdspan != 202207L |
93 | # error "__cpp_lib_mdspan should have the value 202207L in c++23" |
94 | # endif |
95 | |
96 | # ifdef __cpp_lib_submdspan |
97 | # error "__cpp_lib_submdspan should not be defined before c++26" |
98 | # endif |
99 | |
100 | #elif TEST_STD_VER > 23 |
101 | |
102 | # if !defined(_LIBCPP_VERSION) |
103 | # ifndef __cpp_lib_freestanding_mdspan |
104 | # error "__cpp_lib_freestanding_mdspan should be defined in c++26" |
105 | # endif |
106 | # if __cpp_lib_freestanding_mdspan != 202311L |
107 | # error "__cpp_lib_freestanding_mdspan should have the value 202311L in c++26" |
108 | # endif |
109 | # else // _LIBCPP_VERSION |
110 | # ifdef __cpp_lib_freestanding_mdspan |
111 | # error "__cpp_lib_freestanding_mdspan should not be defined because it is unimplemented in libc++!" |
112 | # endif |
113 | # endif |
114 | |
115 | # ifndef __cpp_lib_mdspan |
116 | # error "__cpp_lib_mdspan should be defined in c++26" |
117 | # endif |
118 | # if __cpp_lib_mdspan != 202207L |
119 | # error "__cpp_lib_mdspan should have the value 202207L in c++26" |
120 | # endif |
121 | |
122 | # if !defined(_LIBCPP_VERSION) |
123 | # ifndef __cpp_lib_submdspan |
124 | # error "__cpp_lib_submdspan should be defined in c++26" |
125 | # endif |
126 | # if __cpp_lib_submdspan != 202306L |
127 | # error "__cpp_lib_submdspan should have the value 202306L in c++26" |
128 | # endif |
129 | # else // _LIBCPP_VERSION |
130 | # ifdef __cpp_lib_submdspan |
131 | # error "__cpp_lib_submdspan should not be defined because it is unimplemented in libc++!" |
132 | # endif |
133 | # endif |
134 | |
135 | #endif // TEST_STD_VER > 23 |
136 | |
137 | |