15a83710eSEric Fiselier //===----------------------------------------------------------------------===//
25a83710eSEric Fiselier //
357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
65a83710eSEric Fiselier //
75a83710eSEric Fiselier //===----------------------------------------------------------------------===//
8c32d47c6SMichal Gorny //
9c32d47c6SMichal Gorny // NetBSD does not support LC_COLLATE at the moment
10c32d47c6SMichal Gorny // XFAIL: netbsd
11*bf4ddf18Szhijian // XFAIL: LIBCXX-AIX-FIXME
125a83710eSEric Fiselier 
135a83710eSEric Fiselier // REQUIRES: locale.cs_CZ.ISO8859-2
145a83710eSEric Fiselier 
155a83710eSEric Fiselier // <regex>
165a83710eSEric Fiselier 
175a83710eSEric Fiselier // template <class charT> struct regex_traits;
185a83710eSEric Fiselier 
195a83710eSEric Fiselier // template <class ForwardIterator>
205a83710eSEric Fiselier //   string_type transform(ForwardIterator first, ForwardIterator last) const;
215a83710eSEric Fiselier 
225a83710eSEric Fiselier #include <regex>
235a83710eSEric Fiselier #include <cassert>
24fd5ceb22SMarshall Clow #include "test_macros.h"
255a83710eSEric Fiselier #include "test_iterators.h"
26f424990dSEd Schouten #include "platform_support.h" // locale name macros
27f424990dSEd Schouten 
main(int,char **)282df59c50SJF Bastien int main(int, char**)
295a83710eSEric Fiselier {
305a83710eSEric Fiselier     {
315a83710eSEric Fiselier         std::regex_traits<char> t;
325a83710eSEric Fiselier         const char a[] = "a";
335a83710eSEric Fiselier         const char B[] = "B";
345a83710eSEric Fiselier         typedef forward_iterator<const char*> F;
355a83710eSEric Fiselier         assert(t.transform(F(a), F(a+1)) > t.transform(F(B), F(B+1)));
36f424990dSEd Schouten         t.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2));
375a83710eSEric Fiselier         assert(t.transform(F(a), F(a+1)) < t.transform(F(B), F(B+1)));
385a83710eSEric Fiselier     }
39f4c1258dSLouis Dionne #ifndef TEST_HAS_NO_WIDE_CHARACTERS
405a83710eSEric Fiselier     {
415a83710eSEric Fiselier         std::regex_traits<wchar_t> t;
425a83710eSEric Fiselier         const wchar_t a[] = L"a";
435a83710eSEric Fiselier         const wchar_t B[] = L"B";
445a83710eSEric Fiselier         typedef forward_iterator<const wchar_t*> F;
455a83710eSEric Fiselier         assert(t.transform(F(a), F(a+1)) > t.transform(F(B), F(B+1)));
46f424990dSEd Schouten         t.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2));
475a83710eSEric Fiselier         assert(t.transform(F(a), F(a+1)) < t.transform(F(B), F(B+1)));
485a83710eSEric Fiselier     }
49f4c1258dSLouis Dionne #endif
502df59c50SJF Bastien 
512df59c50SJF Bastien   return 0;
525a83710eSEric Fiselier }
53