Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / libcxx / test / std / re / re.traits / default.pass.cpp
blobff817cb56f2c887e3eaf57aeed9aa1e07e41ee1b
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 // REQUIRES: locale.en_US.UTF-8
11 // <regex>
13 // template <class charT> struct regex_traits;
15 // regex_traits();
17 #include <regex>
18 #include <cassert>
20 #include "test_macros.h"
21 #include "platform_support.h" // locale name macros
23 int main(int, char**)
26 std::regex_traits<char> t;
27 assert(t.getloc().name() == "C");
29 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
31 std::regex_traits<wchar_t> t;
32 assert(t.getloc().name() == "C");
34 #endif
36 std::locale::global(std::locale(LOCALE_en_US_UTF_8));
37 std::regex_traits<char> t;
38 assert(t.getloc().name() == LOCALE_en_US_UTF_8);
40 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
42 std::locale::global(std::locale(LOCALE_en_US_UTF_8));
43 std::regex_traits<wchar_t> t;
44 assert(t.getloc().name() == LOCALE_en_US_UTF_8);
46 #endif
48 return 0;