Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / libcxx / test / std / time / time.zone / time.zone.info / time.zone.info.local / local_info.members.pass.cpp
blobf246d5954d637f4ed6a22a8b0eceadcda1e1a58c
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
11 // XFAIL: libcpp-has-no-experimental-tzdb
13 // <chrono>
15 // struct local_info {
16 // static constexpr int unique = 0;
17 // static constexpr int nonexistent = 1;
18 // static constexpr int ambiguous = 2;
20 // int result;
21 // sys_info first;
22 // sys_info second;
23 // };
25 // Validates whether:
26 // - The static members are present as static constexpr members.
27 // - The members are present as non-const members.
28 // - The struct is an aggregate.
30 #include <chrono>
31 #include <string>
32 #include <type_traits>
34 int main(int, const char**) {
36 constexpr const int& result = std::chrono::local_info::unique;
37 static_assert(result == 0);
40 constexpr const int& result = std::chrono::local_info::nonexistent;
41 static_assert(result == 1);
44 constexpr const int& result = std::chrono::local_info::ambiguous;
45 static_assert(result == 2);
48 static_assert(std::is_aggregate_v<std::chrono::local_info>);
50 std::chrono::local_info local_info{.result = 0, .first = std::chrono::sys_info{}, .second = std::chrono::sys_info{}};
52 [[maybe_unused]] int& result = local_info.result;
53 [[maybe_unused]] std::chrono::sys_info& first = local_info.first;
54 [[maybe_unused]] std::chrono::sys_info& second = local_info.second;
56 return 0;