[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / time / time.duration / time.duration.special / zero.pass.cpp
bloba3f535071d7a982f2d80d097f8279b3a02d17ff5
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 zero(); // noexcept after C++17
15 #include <chrono>
16 #include <cassert>
18 #include "test_macros.h"
19 #include "../../rep.h"
21 template <class D>
22 void test()
24 LIBCPP_ASSERT_NOEXCEPT(std::chrono::duration_values<typename D::rep>::zero());
25 #if TEST_STD_VER > 17
26 ASSERT_NOEXCEPT( std::chrono::duration_values<typename D::rep>::zero());
27 #endif
29 typedef typename D::rep DRep;
30 DRep zero_rep = std::chrono::duration_values<DRep>::zero();
31 assert(D::zero().count() == zero_rep);
33 #if TEST_STD_VER >= 11
35 typedef typename D::rep DRep;
36 constexpr DRep zero_rep = std::chrono::duration_values<DRep>::zero();
37 static_assert(D::zero().count() == zero_rep, "");
39 #endif
42 int main(int, char**)
44 test<std::chrono::duration<int> >();
45 test<std::chrono::duration<Rep> >();
47 return 0;