| 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 |
// <source_location> |
| 15 |
|
| 16 |
// Test the feature test macros defined by <source_location> |
| 17 |
|
| 18 |
/* Constant Value |
| 19 |
__cpp_lib_source_location 201907L [C++20] |
| 20 |
*/ |
| 21 |
|
| 22 |
#include <source_location> |
| 23 |
#include "test_macros.h" |
| 24 |
|
| 25 |
#if TEST_STD_VER < 14 |
| 26 |
|
| 27 |
# ifdef __cpp_lib_source_location |
| 28 |
# error "__cpp_lib_source_location should not be defined before c++20" |
| 29 |
# endif |
| 30 |
|
| 31 |
#elif TEST_STD_VER == 14 |
| 32 |
|
| 33 |
# ifdef __cpp_lib_source_location |
| 34 |
# error "__cpp_lib_source_location should not be defined before c++20" |
| 35 |
# endif |
| 36 |
|
| 37 |
#elif TEST_STD_VER == 17 |
| 38 |
|
| 39 |
# ifdef __cpp_lib_source_location |
| 40 |
# error "__cpp_lib_source_location should not be defined before c++20" |
| 41 |
# endif |
| 42 |
|
| 43 |
#elif TEST_STD_VER == 20 |
| 44 |
|
| 45 |
# ifndef __cpp_lib_source_location |
| 46 |
# error "__cpp_lib_source_location should be defined in c++20" |
| 47 |
# endif |
| 48 |
# if __cpp_lib_source_location != 201907L |
| 49 |
# error "__cpp_lib_source_location should have the value 201907L in c++20" |
| 50 |
# endif |
| 51 |
|
| 52 |
#elif TEST_STD_VER == 23 |
| 53 |
|
| 54 |
# ifndef __cpp_lib_source_location |
| 55 |
# error "__cpp_lib_source_location should be defined in c++23" |
| 56 |
# endif |
| 57 |
# if __cpp_lib_source_location != 201907L |
| 58 |
# error "__cpp_lib_source_location should have the value 201907L in c++23" |
| 59 |
# endif |
| 60 |
|
| 61 |
#elif TEST_STD_VER > 23 |
| 62 |
|
| 63 |
# ifndef __cpp_lib_source_location |
| 64 |
# error "__cpp_lib_source_location should be defined in c++26" |
| 65 |
# endif |
| 66 |
# if __cpp_lib_source_location != 201907L |
| 67 |
# error "__cpp_lib_source_location should have the value 201907L in c++26" |
| 68 |
# endif |
| 69 |
|
| 70 |
#endif // TEST_STD_VER > 23 |
| 71 |
|