[FMV][AArch64] Changes in fmv-features metadata. (#122192)
[llvm-project.git] / libcxx / test / std / time / time.point / time.point.arithmetic / op_-=.pass.cpp
blob2365d539ca77513213e0f8feefe6e74b41defd2f
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 // time_point& operator-=(const duration& d);
14 // constexpr in c++17
16 #include <chrono>
17 #include <cassert>
19 #include "test_macros.h"
21 #if TEST_STD_VER > 14
22 constexpr bool constexpr_test()
24 typedef std::chrono::system_clock Clock;
25 typedef std::chrono::milliseconds Duration;
26 std::chrono::time_point<Clock, Duration> t(Duration(5));
27 t -= Duration(4);
28 return t.time_since_epoch() == Duration(1);
30 #endif
32 int main(int, char**)
35 typedef std::chrono::system_clock Clock;
36 typedef std::chrono::milliseconds Duration;
37 std::chrono::time_point<Clock, Duration> t(Duration(3));
38 t -= Duration(2);
39 assert(t.time_since_epoch() == Duration(1));
42 #if TEST_STD_VER > 14
43 static_assert(constexpr_test(), "");
44 #endif
46 return 0;