[flang][cuda] Do not apply implicit data attribute on dummy arg with VALUE (#119927)
[llvm-project.git] / libcxx / test / std / time / time.duration / time.duration.comparisons / op_less.pass.cpp
blob9f05f2855c23531a357af51160b54d83dbe570d3
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 // duration
13 // template <class Rep1, class Period1, class Rep2, class Period2>
14 // constexpr
15 // bool
16 // operator< (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
18 // template <class Rep1, class Period1, class Rep2, class Period2>
19 // constexpr
20 // bool
21 // operator> (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
23 // template <class Rep1, class Period1, class Rep2, class Period2>
24 // constexpr
25 // bool
26 // operator<=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
28 // template <class Rep1, class Period1, class Rep2, class Period2>
29 // constexpr
30 // bool
31 // operator>=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
33 #include <chrono>
34 #include <cassert>
35 #include <ratio>
37 #include "test_macros.h"
39 int main(int, char**)
42 std::chrono::seconds s1(3);
43 std::chrono::seconds s2(3);
44 assert(!(s1 < s2));
45 assert(!(s1 > s2));
46 assert( (s1 <= s2));
47 assert( (s1 >= s2));
50 std::chrono::seconds s1(3);
51 std::chrono::seconds s2(4);
52 assert( (s1 < s2));
53 assert(!(s1 > s2));
54 assert( (s1 <= s2));
55 assert(!(s1 >= s2));
58 std::chrono::milliseconds s1(3);
59 std::chrono::microseconds s2(3000);
60 assert(!(s1 < s2));
61 assert(!(s1 > s2));
62 assert( (s1 <= s2));
63 assert( (s1 >= s2));
66 std::chrono::milliseconds s1(3);
67 std::chrono::microseconds s2(4000);
68 assert( (s1 < s2));
69 assert(!(s1 > s2));
70 assert( (s1 <= s2));
71 assert(!(s1 >= s2));
74 std::chrono::duration<int, std::ratio<2, 3> > s1(9);
75 std::chrono::duration<int, std::ratio<3, 5> > s2(10);
76 assert(!(s1 < s2));
77 assert(!(s1 > s2));
78 assert( (s1 <= s2));
79 assert( (s1 >= s2));
82 std::chrono::duration<int, std::ratio<2, 3> > s1(10);
83 std::chrono::duration<int, std::ratio<3, 5> > s2(9);
84 assert(!(s1 < s2));
85 assert( (s1 > s2));
86 assert(!(s1 <= s2));
87 assert( (s1 >= s2));
90 std::chrono::duration<int, std::ratio<2, 3> > s1(9);
91 std::chrono::duration<double, std::ratio<3, 5> > s2(10);
92 assert(!(s1 < s2));
93 assert(!(s1 > s2));
94 assert( (s1 <= s2));
95 assert( (s1 >= s2));
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), "");
154 #endif
156 return 0;