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 Rep1, class Period1, class Rep2, class Period2>
16 // operator< (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
18 // template <class Rep1, class Period1, class Rep2, class Period2>
21 // operator> (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
23 // template <class Rep1, class Period1, class Rep2, class Period2>
26 // operator<=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
28 // template <class Rep1, class Period1, class Rep2, class Period2>
31 // operator>=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
37 #include "test_macros.h"
42 std::chrono::seconds
s1(3);
43 std::chrono::seconds
s2(3);
50 std::chrono::seconds
s1(3);
51 std::chrono::seconds
s2(4);
58 std::chrono::milliseconds
s1(3);
59 std::chrono::microseconds
s2(3000);
66 std::chrono::milliseconds
s1(3);
67 std::chrono::microseconds
s2(4000);
74 std::chrono::duration
<int, std::ratio
<2, 3> > s1(9);
75 std::chrono::duration
<int, std::ratio
<3, 5> > s2(10);
82 std::chrono::duration
<int, std::ratio
<2, 3> > s1(10);
83 std::chrono::duration
<int, std::ratio
<3, 5> > s2(9);
90 std::chrono::duration
<int, std::ratio
<2, 3> > s1(9);
91 std::chrono::duration
<double, std::ratio
<3, 5> > s2(10);
97 #if TEST_STD_VER >= 11
99 constexpr std::chrono::seconds
s1(3);
100 constexpr std::chrono::seconds
s2(3);
101 static_assert(!(s1
< s2
), "");
102 static_assert(!(s1
> s2
), "");
103 static_assert( (s1
<= s2
), "");
104 static_assert( (s1
>= s2
), "");
107 constexpr std::chrono::seconds
s1(3);
108 constexpr std::chrono::seconds
s2(4);
109 static_assert( (s1
< s2
), "");
110 static_assert(!(s1
> s2
), "");
111 static_assert( (s1
<= s2
), "");
112 static_assert(!(s1
>= s2
), "");
115 constexpr std::chrono::milliseconds
s1(3);
116 constexpr std::chrono::microseconds
s2(3000);
117 static_assert(!(s1
< s2
), "");
118 static_assert(!(s1
> s2
), "");
119 static_assert( (s1
<= s2
), "");
120 static_assert( (s1
>= s2
), "");
123 constexpr std::chrono::milliseconds
s1(3);
124 constexpr std::chrono::microseconds
s2(4000);
125 static_assert( (s1
< s2
), "");
126 static_assert(!(s1
> s2
), "");
127 static_assert( (s1
<= s2
), "");
128 static_assert(!(s1
>= s2
), "");
131 constexpr std::chrono::duration
<int, std::ratio
<2, 3> > s1(9);
132 constexpr std::chrono::duration
<int, std::ratio
<3, 5> > s2(10);
133 static_assert(!(s1
< s2
), "");
134 static_assert(!(s1
> s2
), "");
135 static_assert( (s1
<= s2
), "");
136 static_assert( (s1
>= s2
), "");
139 constexpr std::chrono::duration
<int, std::ratio
<2, 3> > s1(10);
140 constexpr std::chrono::duration
<int, std::ratio
<3, 5> > s2(9);
141 static_assert(!(s1
< s2
), "");
142 static_assert( (s1
> s2
), "");
143 static_assert(!(s1
<= s2
), "");
144 static_assert( (s1
>= s2
), "");
147 constexpr std::chrono::duration
<int, std::ratio
<2, 3> > s1(9);
148 constexpr std::chrono::duration
<double, std::ratio
<3, 5> > s2(10);
149 static_assert(!(s1
< s2
), "");
150 static_assert(!(s1
> s2
), "");
151 static_assert( (s1
<= s2
), "");
152 static_assert( (s1
>= s2
), "");