[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / re / re.traits / transform_primary.pass.cpp
blobe24125e0691eba7284dfe57241f8258e2aed67b1
1 // -*- C++ -*-
2 //===----------------------------------------------------------------------===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // NetBSD does not support LC_COLLATE at the moment
11 // XFAIL: netbsd
13 // REQUIRES: locale.cs_CZ.ISO8859-2
15 // <regex>
17 // template <class charT> struct regex_traits;
19 // template <class ForwardIterator>
20 // string_type
21 // transform_primary(ForwardIterator first, ForwardIterator last) const;
23 #include <regex>
24 #include <cassert>
26 #include "test_macros.h"
27 #include "test_iterators.h"
28 #include "platform_support.h" // locale name macros
30 int main(int, char**)
33 std::regex_traits<char> t;
34 const char A[] = "A";
35 const char Aacute[] = "\xC1";
36 typedef forward_iterator<const char*> F;
37 assert(t.transform_primary(F(A), F(A+1)) !=
38 t.transform_primary(F(Aacute), F(Aacute+1)));
39 t.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2));
40 assert(t.transform_primary(F(A), F(A+1)) ==
41 t.transform_primary(F(Aacute), F(Aacute+1)));
44 std::regex_traits<wchar_t> t;
45 const wchar_t A[] = L"A";
46 const wchar_t Aacute[] = L"\xC1";
47 typedef forward_iterator<const wchar_t*> F;
48 assert(t.transform_primary(F(A), F(A+1)) !=
49 t.transform_primary(F(Aacute), F(Aacute+1)));
50 t.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2));
51 assert(t.transform_primary(F(A), F(A+1)) ==
52 t.transform_primary(F(Aacute), F(Aacute+1)));
55 return 0;