• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 weekday;
12 
13 // constexpr bool operator==(const weekday& x, const weekday& y) noexcept;
14 // constexpr bool operator!=(const weekday& x, const weekday& y) noexcept;
15 
16 
17 #include <chrono>
18 #include <type_traits>
19 #include <cassert>
20 
21 #include "test_macros.h"
22 #include "test_comparisons.h"
23 
main(int,char **)24 int main(int, char**)
25 {
26     using weekday = std::chrono::weekday;
27 
28     AssertComparisons2AreNoexcept<weekday>();
29     AssertComparisons2ReturnBool<weekday>();
30 
31     static_assert(testComparisons2Values<weekday>(0U ,0U), "");
32     static_assert(testComparisons2Values<weekday>(0U, 1U), "");
33 
34 //  Some 'ok' values as well
35     static_assert(testComparisons2Values<weekday>(5U, 5U), "");
36     static_assert(testComparisons2Values<weekday>(5U, 2U), "");
37 
38     for (unsigned i = 0; i < 6; ++i)
39         for (unsigned j = 0; j < 6; ++j)
40             assert(testComparisons2Values<weekday>(i, j));
41 
42   return 0;
43 }
44