[AMDGPU] Assert if stack grows downwards. (#119888)
[llvm-project.git] / libcxx / test / std / time / time.zone / time.zone.zonedtime / time.zone.zonedtime.nonmembers / eq.pass.cpp
blob11425a5185d775c2e4994876a9ff3ffedbcd48a7
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 // UNSUPPORTED: c++03, c++11, c++14, c++17
10 // UNSUPPORTED: no-filesystem, no-localization, no-tzdb
12 // XFAIL: libcpp-has-no-experimental-tzdb
13 // XFAIL: availability-tzdb-missing
15 // <chrono>
17 // template<class Duration1, class Duration2, class TimeZonePtr>
18 // bool operator==(const zoned_time<Duration1, TimeZonePtr>& x,
19 // const zoned_time<Duration2, TimeZonePtr>& y);
21 // Note operator!= is generated by the compiler
23 #include <chrono>
25 #include "test_comparisons.h"
27 int main(int, char**) {
29 std::chrono::zoned_time zt;
30 assert(testEquality(zt, zt, true));
33 std::chrono::zoned_time lhs{"UTC"};
34 std::chrono::zoned_time rhs{"Europe/Berlin"};
35 assert(testEquality(lhs, rhs, false));
38 std::chrono::zoned_time lhs{"UTC", std::chrono::sys_time<std::chrono::seconds>{std::chrono::seconds{123}}};
40 assert(testEquality(lhs,
41 std::chrono::zoned_time{
42 std::chrono::sys_time<std::chrono::nanoseconds>{std::chrono::nanoseconds{123'000'000'000}}},
43 true));
44 assert(testEquality(lhs,
45 std::chrono::zoned_time{
46 std::chrono::sys_time<std::chrono::nanoseconds>{std::chrono::nanoseconds{123'000'000'001}}},
47 false));
49 assert(testEquality(lhs,
50 std::chrono::zoned_time{
51 std::chrono::sys_time<std::chrono::microseconds>{std::chrono::microseconds{123'000'000}}},
52 true));
53 assert(testEquality(lhs,
54 std::chrono::zoned_time{
55 std::chrono::sys_time<std::chrono::microseconds>{std::chrono::microseconds{123'000'001}}},
56 false));
58 assert(testEquality(
59 lhs,
60 std::chrono::zoned_time{std::chrono::sys_time<std::chrono::milliseconds>{std::chrono::milliseconds{123'000}}},
61 true));
62 assert(testEquality(
63 lhs,
64 std::chrono::zoned_time{std::chrono::sys_time<std::chrono::milliseconds>{std::chrono::milliseconds{123'001}}},
65 false));
68 return 0;