]> granicus.if.org Git - icu/commitdiff
ICU-13636 The VS2017 optimizer has issues with this function. Disable optimizations...
authorJeff Genovy <29107334+jefgen@users.noreply.github.com>
Tue, 13 Mar 2018 01:10:11 +0000 (01:10 +0000)
committerJeff Genovy <29107334+jefgen@users.noreply.github.com>
Tue, 13 Mar 2018 01:10:11 +0000 (01:10 +0000)
X-SVN-Rev: 41095

icu4c/source/test/cintltst/utf8tst.c

index b7062e3b82f5030b27b291d9b51544e8c53c8f3c..9f4109c20783274b17ec6f6675e3e899008a479a 100644 (file)
@@ -757,6 +757,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.
@@ -842,6 +850,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 };