[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / time / time.duration / time.duration.arithmetic / op_mod=duration.pass.cpp
blob499a06e273836e955e2b8564a3292779476ad1a6
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 // duration& operator%=(const duration& rhs)
15 #include <chrono>
16 #include <cassert>
18 #include "test_macros.h"
19 #include "../../rep.h"
21 #if TEST_STD_VER > 14
22 constexpr bool test_constexpr()
24 std::chrono::microseconds us1(11);
25 std::chrono::microseconds us2(3);
26 us1 %= us2;
27 return us1.count() == 2;
29 #endif
31 int main(int, char**)
34 std::chrono::microseconds us1(11);
35 std::chrono::microseconds us2(3);
36 us1 %= us2;
37 assert(us1.count() == 2);
38 us1 %= std::chrono::milliseconds(3);
39 assert(us1.count() == 2);
42 #if TEST_STD_VER > 14
43 static_assert(test_constexpr(), "");
44 #endif
46 #if TEST_STD_VER >= 11
47 { // This is PR#41130
48 std::chrono::nanoseconds d(5);
49 NotARep n;
50 d %= n;
51 assert(d.count() == 5);
53 #endif
55 return 0;