[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / time / time.cal / time.cal.year / time.cal.year.nonmembers / comparisons.pass.cpp
blob497cc3a42e76199e1f7b138c5dc4f23f45420c83
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
10 // <chrono>
11 // class year;
13 // constexpr bool operator==(const year& x, const year& y) noexcept;
14 // constexpr strong_ordering operator<=>(const year& x, const year& y) noexcept;
16 #include <chrono>
17 #include <type_traits>
18 #include <cassert>
20 #include "test_macros.h"
21 #include "test_comparisons.h"
23 constexpr bool test() {
24 using year = std::chrono::year;
26 // Validate valid value. The range [-32768, 32767] is guaranteed to be allowed.
27 assert(testOrderValues<year>(-32768, -32768));
28 assert(testOrderValues<year>(-32768, -32767));
29 // Largest positive
30 assert(testOrderValues<year>(32767, 32766));
31 assert(testOrderValues<year>(32767, 32767));
33 // Validate some valid values.
34 for (int i = 1; i < 10; ++i)
35 for (int j = 1; j < 10; ++j)
36 assert(testOrderValues<year>(i, j));
38 return true;
41 int main(int, char**) {
42 using year = std::chrono::year;
43 AssertOrderAreNoexcept<year>();
44 AssertOrderReturn<std::strong_ordering, year>();
46 test();
47 static_assert(test());
49 return 0;