1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
13 // template <class Clock, class Duration1, class Duration2>
15 // operator< (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
17 // template <class Clock, class Duration1, class Duration2>
19 // operator> (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
21 // template <class Clock, class Duration1, class Duration2>
23 // operator<=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
25 // template <class Clock, class Duration1, class Duration2>
27 // operator>=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
32 #include "test_macros.h"
36 typedef std::chrono::system_clock Clock
;
37 typedef std::chrono::milliseconds Duration1
;
38 typedef std::chrono::microseconds Duration2
;
39 typedef std::chrono::time_point
<Clock
, Duration1
> T1
;
40 typedef std::chrono::time_point
<Clock
, Duration2
> T2
;
60 T2
t2(Duration2(3000));
68 T2
t2(Duration2(3001));
77 constexpr T1
t1(Duration1(3));
78 constexpr T1
t2(Duration1(3));
79 static_assert(!(t1
< t2
), "");
80 static_assert(!(t1
> t2
), "");
81 static_assert( (t1
<= t2
), "");
82 static_assert( (t1
>= t2
), "");
85 constexpr T1
t1(Duration1(3));
86 constexpr T1
t2(Duration1(4));
87 static_assert( (t1
< t2
), "");
88 static_assert(!(t1
> t2
), "");
89 static_assert( (t1
<= t2
), "");
90 static_assert(!(t1
>= t2
), "");
93 constexpr T1
t1(Duration1(3));
94 constexpr T2
t2(Duration2(3000));
95 static_assert(!(t1
< t2
), "");
96 static_assert(!(t1
> t2
), "");
97 static_assert( (t1
<= t2
), "");
98 static_assert( (t1
>= t2
), "");
101 constexpr T1
t1(Duration1(3));
102 constexpr T2
t2(Duration2(3001));
103 static_assert( (t1
< t2
), "");
104 static_assert(!(t1
> t2
), "");
105 static_assert( (t1
<= t2
), "");
106 static_assert(!(t1
>= t2
), "");