[DAG] TransformFPLoadStorePair - early out if we're not loading a simple type
[llvm-project.git] / libcxx / test / support / test_chrono_leap_second.h
blobbe5ce760bfe98eb0196cce8e660cd9dc0a449a1b
1 // -*- C++ -*-
2 //===----------------------------------------------------------------------===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
10 #ifndef SUPPORT_TEST_CHRONO_LEAP_SECOND_HPP
11 #define SUPPORT_TEST_CHRONO_LEAP_SECOND_HPP
13 // Contains helper functions to create a std::chrono::leap_second.
15 // Since the standard doesn't specify how a @ref std::chrono::leap_second is
16 // constructed this is implementation defined. To make the public API tests of
17 // the class generic this header defines helper functions to create the
18 // required object.
20 // Note This requires every standard library implementation to write their own
21 // helper function. Vendors are encouraged to create a pull request at
22 // https://github.com/llvm/llvm-project so their specific implementation can be
23 // part of this file.
25 #include "test_macros.h"
27 #if TEST_STD_VER < 20
28 # error "The format header requires at least C++20"
29 #endif
31 #include <chrono>
33 #ifdef _LIBCPP_VERSION
35 # include <__utility/private_constructor_tag.h>
37 inline constexpr std::chrono::leap_second
38 test_leap_second_create(const std::chrono::sys_seconds& date, const std::chrono::seconds& value) {
39 return std::chrono::leap_second{std::__private_constructor_tag{}, date, value};
42 #else // _LIBCPP_VERSION
43 # error \
44 "Please create a vendor specific version of the test typedef and file a PR at https://github.com/llvm/llvm-project"
45 #endif // _LIBCPP_VERSION
47 #endif // SUPPORT_TEST_CHRONO_LEAP_SECOND_HPP