ICU-13654 Port MSVC fix from ticket 13636 to ICU4C v60 maint branch.

X-SVN-Rev: 41503
This commit is contained in:
Jeff Genovy 2018-06-01 19:08:03 +00:00
parent e387c69929
commit dec5620c11

View file

@ -755,6 +755,14 @@ static void TestFwdBack() {
}
}
/**
* Ticket #13636 - Visual Studio 2017 has problems optimizing this function.
* As a workaround, we will turn off optimization just for this function on VS2017 and above.
*/
#if defined(_MSC_VER) && (_MSC_VER > 1900)
#pragma optimize( "", off )
#endif
static void TestFwdBackUnsafe() {
/*
* Use a (mostly) well-formed UTF-8 string and test at code point boundaries.
@ -840,6 +848,13 @@ static void TestFwdBackUnsafe() {
}
}
/**
* Ticket #13636 - Turn optimization back on.
*/
#if defined(_MSC_VER) && (_MSC_VER > 1900)
#pragma optimize( "", on )
#endif
static void TestSetChar() {
static const uint8_t input[]
= {0x61, 0xe4, 0xba, 0x8c, 0x7f, 0xfe, 0x62, 0xc5, 0x7f, 0x61, 0x80, 0x80, 0xe0, 0x00 };