Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / libcxx / test / std / re / re.traits / transform.pass.cpp
blob80cd3f01faff2fbf2c3466214520c38cb9a5d6f1
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 // NetBSD does not support LC_COLLATE at the moment
10 // XFAIL: netbsd
12 // REQUIRES: locale.cs_CZ.ISO8859-2
14 // <regex>
16 // template <class charT> struct regex_traits;
18 // template <class ForwardIterator>
19 // string_type transform(ForwardIterator first, ForwardIterator last) const;
21 #include <regex>
22 #include <cassert>
23 #include "test_macros.h"
24 #include "test_iterators.h"
25 #include "platform_support.h" // locale name macros
27 int main(int, char**)
30 std::regex_traits<char> t;
31 const char a[] = "a";
32 const char B[] = "B";
33 typedef forward_iterator<const char*> F;
34 assert(t.transform(F(a), F(a+1)) > t.transform(F(B), F(B+1)));
35 t.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2));
36 assert(t.transform(F(a), F(a+1)) < t.transform(F(B), F(B+1)));
38 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
40 std::regex_traits<wchar_t> t;
41 const wchar_t a[] = L"a";
42 const wchar_t B[] = L"B";
43 typedef forward_iterator<const wchar_t*> F;
44 assert(t.transform(F(a), F(a+1)) > t.transform(F(B), F(B+1)));
45 t.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2));
46 assert(t.transform(F(a), F(a+1)) < t.transform(F(B), F(B+1)));
48 #endif
50 return 0;