This PR is to fix a few UTF16 and UTF32 related test cases that are testing member functions for https://en.cppreference.com/w/cpp/locale/codecvt class , functions are converting from UTF16, UTF32 to UTF8 or vise visa. Test cases need to explicitly specify it is UNICODE character for UTF16/32 type in order to be valid tests to match type in documentation. it assumes it will be ASCII or UTF8 type for 1 byte character ( value range from 1 to 127 ), which is not true on z/OS in EBCDIC mode. For information related to UTF16/32 , please see https://naveenr.net/unicode-character-set-and-utf-8-utf-16-utf-32-encoding/ , and EBCDIC/ASCII character value can be found in http://www.simotime.com/asc2ebc1.htm
Differential Revision: https://reviews.llvm.org/D106151
int main(int, char**) {
using F = std::codecvt<char16_t, char8_t, std::mbstate_t>;
const F& f = std::use_facet<F>(std::locale::classic());
- F::intern_type from[9] = {'s', 'o', 'm', 'e', ' ', 't', 'e', 'x', 't'};
+ F::intern_type from[9] = {u's', u'o', u'm', u'e', u' ', u't', u'e', u'x', u't'};
F::extern_type to[9] = {0};
std::mbstate_t mbs = {};
const F::intern_type* from_next = nullptr;
// This test runs in C++20, but we have deprecated codecvt<char(16|32), char, mbstate_t> in C++20.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// UNSUPPORTED: target={{.+}}-zos{{.*}}
+
#include <locale>
#include <string>
#include <vector>
int main(int, char**) {
using F = std::codecvt<char32_t, char8_t, std::mbstate_t>;
const F& f = std::use_facet<F>(std::locale::classic());
- F::intern_type from[9] = {'s', 'o', 'm', 'e', ' ', 't', 'e', 'x', 't'};
+ F::intern_type from[9] = {u's', u'o', u'm', u'e', u' ', u't', u'e', u'x', u't'};
F::extern_type to[9] = {0};
std::mbstate_t mbs = {};
const F::intern_type* from_next = nullptr;
// This test runs in C++20, but we have deprecated codecvt<char(16|32), char, mbstate_t> in C++20.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+// UNSUPPORTED: target={{.+}}-zos{{.*}}
+
#include <locale>
#include <string>
#include <vector>