Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / libcxx / test / std / re / re.traits / transform_primary.pass.cpp
blob422e3a591e643ded80d6667a318c4f9f04707e98
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 // XFAIL: LIBCXX-AIX-FIXME
13 // XFAIL: LIBCXX-FREEBSD-FIXME
15 // REQUIRES: locale.cs_CZ.ISO8859-2
17 // <regex>
19 // template <class charT> struct regex_traits;
21 // template <class ForwardIterator>
22 // string_type
23 // transform_primary(ForwardIterator first, ForwardIterator last) const;
25 #include <regex>
26 #include <cassert>
28 #include "test_macros.h"
29 #include "test_iterators.h"
30 #include "platform_support.h" // locale name macros
32 int main(int, char**)
35 std::regex_traits<char> t;
36 const char A[] = "A";
37 const char Aacute[] = "\xC1";
38 typedef forward_iterator<const char*> F;
39 assert(t.transform_primary(F(A), F(A+1)) !=
40 t.transform_primary(F(Aacute), F(Aacute+1)));
41 t.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2));
42 assert(t.transform_primary(F(A), F(A+1)) ==
43 t.transform_primary(F(Aacute), F(Aacute+1)));
45 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
47 std::regex_traits<wchar_t> t;
48 const wchar_t A[] = L"A";
49 const wchar_t Aacute[] = L"\xC1";
50 typedef forward_iterator<const wchar_t*> F;
51 assert(t.transform_primary(F(A), F(A+1)) !=
52 t.transform_primary(F(Aacute), F(Aacute+1)));
53 t.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2));
54 assert(t.transform_primary(F(A), F(A+1)) ==
55 t.transform_primary(F(Aacute), F(Aacute+1)));
57 #endif
59 return 0;