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 // UNSUPPORTED: c++03, c++11, c++14, c++17
9 
10 // <chrono>
11 // class day;
12 
13 // constexpr bool operator==(const day& x, const day& y) noexcept;
14 //   Returns: unsigned{x} == unsigned{y}.
15 // constexpr bool operator<(const day& x, const day& y) noexcept;
16 //   Returns: unsigned{x} < unsigned{y}.
17 
18 
19 #include <chrono>
20 #include <type_traits>
21 #include <cassert>
22 
23 #include "test_macros.h"
24 #include "test_comparisons.h"
25 
main(int,char **)26 int main(int, char**)
27 {
28     using day = std::chrono::day;
29 
30     AssertComparisons6AreNoexcept<day>();
31     AssertComparisons6ReturnBool<day>();
32 
33     static_assert(testComparisons6Values<day>(0U, 0U), "");
34     static_assert(testComparisons6Values<day>(0U, 1U), "");
35 
36 //  Some 'ok' values as well
37     static_assert(testComparisons6Values<day>( 5U,  5U), "");
38     static_assert(testComparisons6Values<day>( 5U, 10U), "");
39 
40     for (unsigned i = 1; i < 10; ++i)
41         for (unsigned j = 1; j < 10; ++j)
42             assert(testComparisons6Values<day>(i, j));
43 
44   return 0;
45 }
46