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