[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / time / time.duration / time.duration.special / max.pass.cpp
blobdadd47bb7741c384181a0a415e56f0beb1f2824f
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 //===----------------------------------------------------------------------===//
9 // <chrono>
11 // duration
13 // static constexpr duration max(); // noexcept after C++17
15 #include <chrono>
16 #include <limits>
17 #include <cassert>
19 #include "test_macros.h"
20 #include "../../rep.h"
22 template <class D>
23 void test()
25 LIBCPP_ASSERT_NOEXCEPT(std::chrono::duration_values<typename D::rep>::max());
26 #if TEST_STD_VER > 17
27 ASSERT_NOEXCEPT( std::chrono::duration_values<typename D::rep>::max());
28 #endif
30 typedef typename D::rep DRep;
31 DRep max_rep = std::chrono::duration_values<DRep>::max();
32 assert(D::max().count() == max_rep);
34 #if TEST_STD_VER >= 11
36 typedef typename D::rep DRep;
37 constexpr DRep max_rep = std::chrono::duration_values<DRep>::max();
38 static_assert(D::max().count() == max_rep, "");
40 #endif
43 int main(int, char**)
45 test<std::chrono::duration<int> >();
46 test<std::chrono::duration<Rep> >();
48 return 0;