131 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// WARNING: This test was generated by generate_feature_test_macro_components.py10// and should not be edited manually.11 12// UNSUPPORTED: no-localization13 14// <ostream>15 16// Test the feature test macros defined by <ostream>17 18// clang-format off19 20#include <ostream>21#include "test_macros.h"22 23#if TEST_STD_VER < 1424 25# ifdef __cpp_lib_char8_t26# error "__cpp_lib_char8_t should not be defined before c++20"27# endif28 29# ifdef __cpp_lib_print30# error "__cpp_lib_print should not be defined before c++23"31# endif32 33#elif TEST_STD_VER == 1434 35# ifdef __cpp_lib_char8_t36# error "__cpp_lib_char8_t should not be defined before c++20"37# endif38 39# ifdef __cpp_lib_print40# error "__cpp_lib_print should not be defined before c++23"41# endif42 43#elif TEST_STD_VER == 1744 45# ifdef __cpp_lib_char8_t46# error "__cpp_lib_char8_t should not be defined before c++20"47# endif48 49# ifdef __cpp_lib_print50# error "__cpp_lib_print should not be defined before c++23"51# endif52 53#elif TEST_STD_VER == 2054 55# if defined(__cpp_char8_t)56# ifndef __cpp_lib_char8_t57# error "__cpp_lib_char8_t should be defined in c++20"58# endif59# if __cpp_lib_char8_t != 201907L60# error "__cpp_lib_char8_t should have the value 201907L in c++20"61# endif62# else63# ifdef __cpp_lib_char8_t64# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"65# endif66# endif67 68# ifdef __cpp_lib_print69# error "__cpp_lib_print should not be defined before c++23"70# endif71 72#elif TEST_STD_VER == 2373 74# if defined(__cpp_char8_t)75# ifndef __cpp_lib_char8_t76# error "__cpp_lib_char8_t should be defined in c++23"77# endif78# if __cpp_lib_char8_t != 201907L79# error "__cpp_lib_char8_t should have the value 201907L in c++23"80# endif81# else82# ifdef __cpp_lib_char8_t83# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"84# endif85# endif86 87# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT88# ifndef __cpp_lib_print89# error "__cpp_lib_print should be defined in c++23"90# endif91# if __cpp_lib_print != 202207L92# error "__cpp_lib_print should have the value 202207L in c++23"93# endif94# else95# ifdef __cpp_lib_print96# error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"97# endif98# endif99 100#elif TEST_STD_VER > 23101 102# if defined(__cpp_char8_t)103# ifndef __cpp_lib_char8_t104# error "__cpp_lib_char8_t should be defined in c++26"105# endif106# if __cpp_lib_char8_t != 201907L107# error "__cpp_lib_char8_t should have the value 201907L in c++26"108# endif109# else110# ifdef __cpp_lib_char8_t111# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"112# endif113# endif114 115# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT116# ifndef __cpp_lib_print117# error "__cpp_lib_print should be defined in c++26"118# endif119# if __cpp_lib_print != 202207L120# error "__cpp_lib_print should have the value 202207L in c++26"121# endif122# else123# ifdef __cpp_lib_print124# error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!"125# endif126# endif127 128#endif // TEST_STD_VER > 23129 130// clang-format on131