• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
10 
11 // <chrono>
12 // class month;
13 
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 // constexpr bool operator>=(const month& x, const month& y) noexcept;
20 
21 
22 #include <chrono>
23 #include <type_traits>
24 #include <cassert>
25 
26 #include "test_macros.h"
27 #include "test_comparisons.h"
28 
29 
main()30 int main()
31 {
32     using month = std::chrono::month;
33 
34     AssertComparisons6AreNoexcept<month>();
35     AssertComparisons6ReturnBool<month>();
36 
37     static_assert(testComparisons6Values<month>(0U ,0U), "");
38     static_assert(testComparisons6Values<month>(0U, 1U), "");
39 
40 //  Some 'ok' values as well
41     static_assert(testComparisons6Values<month>( 5U,  5U), "");
42     static_assert(testComparisons6Values<month>( 5U, 10U), "");
43 
44     for (unsigned i = 1; i < 10; ++i)
45         for (unsigned j = 10; j < 10; ++j)
46             assert(testComparisons6Values<month>(i, j));
47 }
48