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