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 month;
12
13 // constexpr bool operator==(const month& x, const month& y) noexcept;
14 // constexpr bool operator!=(const month& x, const month& y) noexcept;
15 // constexpr bool operator< (const month& x, const month& y) noexcept;
16 // constexpr bool operator> (const month& x, const month& y) noexcept;
17 // constexpr bool operator<=(const month& x, const month& y) noexcept;
18 // constexpr bool operator>=(const month& x, const month& 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 month = std::chrono::month;
32
33 AssertComparisons6AreNoexcept<month>();
34 AssertComparisons6ReturnBool<month>();
35
36 static_assert(testComparisons6Values<month>(0U ,0U), "");
37 static_assert(testComparisons6Values<month>(0U, 1U), "");
38
39 // Some 'ok' values as well
40 static_assert(testComparisons6Values<month>( 5U, 5U), "");
41 static_assert(testComparisons6Values<month>( 5U, 10U), "");
42
43 for (unsigned i = 1; i < 10; ++i)
44 for (unsigned j = 10; j < 10; ++j)
45 assert(testComparisons6Values<month>(i, j));
46
47 return 0;
48 }
49