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// <random>
13
14// Test the feature test macros defined by <random>
15
16// clang-format off
17
18#include <random>
19#include "test_macros.h"
20
21#if TEST_STD_VER < 14
22
23# ifdef __cpp_lib_generate_random
24# error "__cpp_lib_generate_random should not be defined before c++26"
25# endif
26
27# ifdef __cpp_lib_philox_engine
28# error "__cpp_lib_philox_engine should not be defined before c++26"
29# endif
30
31#elif TEST_STD_VER == 14
32
33# ifdef __cpp_lib_generate_random
34# error "__cpp_lib_generate_random should not be defined before c++26"
35# endif
36
37# ifdef __cpp_lib_philox_engine
38# error "__cpp_lib_philox_engine should not be defined before c++26"
39# endif
40
41#elif TEST_STD_VER == 17
42
43# ifdef __cpp_lib_generate_random
44# error "__cpp_lib_generate_random should not be defined before c++26"
45# endif
46
47# ifdef __cpp_lib_philox_engine
48# error "__cpp_lib_philox_engine should not be defined before c++26"
49# endif
50
51#elif TEST_STD_VER == 20
52
53# ifdef __cpp_lib_generate_random
54# error "__cpp_lib_generate_random should not be defined before c++26"
55# endif
56
57# ifdef __cpp_lib_philox_engine
58# error "__cpp_lib_philox_engine should not be defined before c++26"
59# endif
60
61#elif TEST_STD_VER == 23
62
63# ifdef __cpp_lib_generate_random
64# error "__cpp_lib_generate_random should not be defined before c++26"
65# endif
66
67# ifdef __cpp_lib_philox_engine
68# error "__cpp_lib_philox_engine should not be defined before c++26"
69# endif
70
71#elif TEST_STD_VER > 23
72
73# if !defined(_LIBCPP_VERSION)
74# ifndef __cpp_lib_generate_random
75# error "__cpp_lib_generate_random should be defined in c++26"
76# endif
77# if __cpp_lib_generate_random != 202403L
78# error "__cpp_lib_generate_random should have the value 202403L in c++26"
79# endif
80# else
81# ifdef __cpp_lib_generate_random
82# error "__cpp_lib_generate_random should not be defined because it is unimplemented in libc++!"
83# endif
84# endif
85
86# if !defined(_LIBCPP_VERSION)
87# ifndef __cpp_lib_philox_engine
88# error "__cpp_lib_philox_engine should be defined in c++26"
89# endif
90# if __cpp_lib_philox_engine != 202406L
91# error "__cpp_lib_philox_engine should have the value 202406L in c++26"
92# endif
93# else
94# ifdef __cpp_lib_philox_engine
95# error "__cpp_lib_philox_engine should not be defined because it is unimplemented in libc++!"
96# endif
97# endif
98
99#endif // TEST_STD_VER > 23
100
101// clang-format on
102
103

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