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 //===----------------------------------------------------------------------===//
8
9 // UNSUPPORTED: c++03, c++11, c++14, c++17
10 // UNSUPPORTED: no-filesystem, no-localization, no-tzdb
11
12 // XFAIL: libcpp-has-no-experimental-tzdb
13 // XFAIL: availability-tzdb-missing
14
15 // <chrono>
16
17 // bool operator==(const time_zone& x, const time_zone& y) noexcept;
18 // strong_ordering operator<=>(const time_zone& x, const time_zone& y) noexcept;
19
20 #include <chrono>
21 #include <cassert>
22
23 #include "test_macros.h"
24 #include "test_comparisons.h"
25
main(int,const char **)26 int main(int, const char**) {
27 const std::chrono::tzdb& tzdb = std::chrono::get_tzdb();
28 assert(tzdb.zones.size() > 2);
29
30 AssertOrderAreNoexcept<std::chrono::time_zone>();
31 AssertOrderReturn<std::strong_ordering, std::chrono::time_zone>();
32
33 assert(testOrder(tzdb.zones[0], tzdb.zones[1], std::strong_ordering::less));
34
35 return 0;
36 }
37