19
19
// TODO: investigation needed
20
20
// TODO(netbsd): incomplete support for locales
21
21
// XFAIL: target={{.*}}-linux-gnu{{.*}}, netbsd, freebsd
22
- // XFAIL: LIBCXX-AIX-FIXME
23
22
// REQUIRES: locale.cs_CZ.ISO8859-2
24
23
25
24
#include < regex>
@@ -35,8 +34,15 @@ int main(int, char**)
35
34
{
36
35
std::cmatch m;
37
36
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
38
43
assert (std::regex_match (s, m,
39
44
std::regex (" [a[=M=]z]" , std::regex_constants::awk)));
45
+ #endif
40
46
assert (m.size () == 1 );
41
47
assert (!m.prefix ().matched );
42
48
assert (m.prefix ().first == s);
@@ -78,8 +84,13 @@ int main(int, char**)
78
84
{
79
85
std::wcmatch m;
80
86
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
81
91
assert (std::regex_match (s, m, std::wregex (L" [a[=M=]z]" ,
82
92
std::regex_constants::awk)));
93
+ #endif
83
94
assert (m.size () == 1 );
84
95
assert (!m.prefix ().matched );
85
96
assert (m.prefix ().first == s);
@@ -91,6 +102,8 @@ int main(int, char**)
91
102
assert (m.position (0 ) == 0 );
92
103
assert (m.str (0 ) == s);
93
104
}
105
+ // TODO: Need to be investigated for AIX OS
106
+ #if !defined(_AIX)
94
107
{
95
108
std::wcmatch m;
96
109
const wchar_t s[] = L" Ch" ;
@@ -107,6 +120,7 @@ int main(int, char**)
107
120
assert (m.position (0 ) == 0 );
108
121
assert (m.str (0 ) == s);
109
122
}
123
+ #endif
110
124
std::locale::global (std::locale (" C" ));
111
125
{
112
126
std::wcmatch m;
0 commit comments