[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / time / time.point / time.point.cons / duration.pass.cpp
blob078c6641e76df6f996eb14068bea49e4e9b5306a
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 // explicit time_point(const duration& d);
15 #include <chrono>
16 #include <cassert>
18 #include "test_macros.h"
20 int main(int, char**)
22 typedef std::chrono::system_clock Clock;
23 typedef std::chrono::milliseconds Duration;
25 std::chrono::time_point<Clock, Duration> t(Duration(3));
26 assert(t.time_since_epoch() == Duration(3));
29 std::chrono::time_point<Clock, Duration> t(std::chrono::seconds(3));
30 assert(t.time_since_epoch() == Duration(3000));
32 #if TEST_STD_VER > 11
34 constexpr std::chrono::time_point<Clock, Duration> t(Duration(3));
35 static_assert(t.time_since_epoch() == Duration(3), "");
38 constexpr std::chrono::time_point<Clock, Duration> t(std::chrono::seconds(3));
39 static_assert(t.time_since_epoch() == Duration(3000), "");
41 #endif
43 return 0;