[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / time / time.point / time.point.nonmember / op_-time_point.pass.cpp
blob22e4520f360047825f8abe9b2e4593a9b2d6c34b
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 // time_point
13 // template <class Clock, class Duration1, class Duration2>
14 // typename common_type<Duration1, Duration2>::type
15 // operator-(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
17 #include <chrono>
18 #include <cassert>
20 #include "test_macros.h"
22 int main(int, char**)
24 typedef std::chrono::system_clock Clock;
25 typedef std::chrono::milliseconds Duration1;
26 typedef std::chrono::microseconds Duration2;
28 std::chrono::time_point<Clock, Duration1> t1(Duration1(3));
29 std::chrono::time_point<Clock, Duration2> t2(Duration2(5));
30 assert((t1 - t2) == Duration2(2995));
32 #if TEST_STD_VER > 11
34 constexpr std::chrono::time_point<Clock, Duration1> t1(Duration1(3));
35 constexpr std::chrono::time_point<Clock, Duration2> t2(Duration2(5));
36 static_assert((t1 - t2) == Duration2(2995), "");
38 #endif
40 return 0;