Skip to content

Commit c24a422

Browse files
committed
[libc++][CI][AIX] modify the equivalence classes of regex_match for locale "cs_CZ.ISO8859-2"
Reviewers: David Tenty, Mark de Wever Differential Revision: https://reviews.llvm.org/D126407
1 parent 6bf043e commit c24a422

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

libcxx/test/std/re/re.alg/re.alg.match/awk.locale.pass.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
// TODO: investigation needed
2020
// TODO(netbsd): incomplete support for locales
2121
// XFAIL: target={{.*}}-linux-gnu{{.*}}, netbsd, freebsd
22-
// XFAIL: LIBCXX-AIX-FIXME
2322
// REQUIRES: locale.cs_CZ.ISO8859-2
2423

2524
#include <regex>
@@ -35,8 +34,15 @@ int main(int, char**)
3534
{
3635
std::cmatch m;
3736
const char s[] = "m";
37+
// AIX supports character equivalence classes. What the contents of the class are depends
38+
// on the locale and the standards do not specify any locale other than C/POSIX.
39+
#if defined(_AIX)
40+
assert(std::regex_match(s, m,
41+
std::regex("[a[=m=]z]", std::regex_constants::awk)));
42+
#else
3843
assert(std::regex_match(s, m,
3944
std::regex("[a[=M=]z]", std::regex_constants::awk)));
45+
#endif
4046
assert(m.size() == 1);
4147
assert(!m.prefix().matched);
4248
assert(m.prefix().first == s);
@@ -78,8 +84,13 @@ int main(int, char**)
7884
{
7985
std::wcmatch m;
8086
const wchar_t s[] = L"m";
87+
#if defined(_AIX)
88+
assert(std::regex_match(s, m, std::wregex(L"[a[=m=]z]",
89+
std::regex_constants::awk)));
90+
#else
8191
assert(std::regex_match(s, m, std::wregex(L"[a[=M=]z]",
8292
std::regex_constants::awk)));
93+
#endif
8394
assert(m.size() == 1);
8495
assert(!m.prefix().matched);
8596
assert(m.prefix().first == s);
@@ -91,6 +102,8 @@ int main(int, char**)
91102
assert(m.position(0) == 0);
92103
assert(m.str(0) == s);
93104
}
105+
//TODO: Need to be investigated for AIX OS
106+
#if !defined(_AIX)
94107
{
95108
std::wcmatch m;
96109
const wchar_t s[] = L"Ch";
@@ -107,6 +120,7 @@ int main(int, char**)
107120
assert(m.position(0) == 0);
108121
assert(m.str(0) == s);
109122
}
123+
#endif
110124
std::locale::global(std::locale("C"));
111125
{
112126
std::wcmatch m;

0 commit comments

Comments
 (0)