• 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 year;
13 
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 // constexpr bool operator>=(const year& x, const year& 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 year = std::chrono::year;
33 
34     AssertComparisons6AreNoexcept<year>();
35     AssertComparisons6ReturnBool<year>();
36 
37     static_assert(testComparisons6Values<year>(0,0), "");
38     static_assert(testComparisons6Values<year>(0,1), "");
39 
40 //  Some 'ok' values as well
41     static_assert(testComparisons6Values<year>( 5, 5), "");
42     static_assert(testComparisons6Values<year>( 5,10), "");
43 
44     for (int i = 1; i < 10; ++i)
45         for (int j = 1; j < 10; ++j)
46             assert(testComparisons6Values<year>(i, j));
47 }
48