mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-10 07:39:16 +00:00
ICU-6888 disable optimization for ICC - merge r26548
X-SVN-Rev: 26551
This commit is contained in:
parent
42a092da36
commit
8177eb72ea
4 changed files with 95 additions and 33 deletions
|
@ -193,13 +193,21 @@ case $platform in
|
|||
;;
|
||||
Linux/ICC)
|
||||
THE_OS="Linux"
|
||||
THE_COMP="Intel ICC 9.0"
|
||||
CC=`which icc`; export CC
|
||||
CXX=`which icpc`; export CXX
|
||||
export CFLAGS="-fp-model precise"
|
||||
export CXXFLAGS="-fp-model precise"
|
||||
ICC_VER=`${CC} -v 2>&1`
|
||||
RELEASE_CFLAGS='-O'
|
||||
RELEASE_CXXFLAGS='-O'
|
||||
export CFLAGS="-fp-model precise"
|
||||
export CXXFLAGS="-fp-model precise"
|
||||
if [ "${ICC_VER}" = "Version 9.0 " ]; then
|
||||
RELEASE_CFLAGS=''
|
||||
RELEASE_CXXFLAGS=''
|
||||
export CFLAGS="${CFLAGS} -O0"
|
||||
export CXXFLAGS="${CXXFLAGS} -O0"
|
||||
echo "ICC 9.0 does not work with optimization- disabling optimizations"
|
||||
fi
|
||||
THE_COMP="Intel ${ICC_VER}"
|
||||
;;
|
||||
Linux/VA)
|
||||
THE_OS="Linux"
|
||||
|
@ -292,7 +300,7 @@ case $platform in
|
|||
THE_COMP="z/OS 1.2 C/C++"
|
||||
CC=cc; export CC
|
||||
CXX=cxx; export CXX
|
||||
export COMPILE_LINK_ENVVAR='_CXX_CVERSION=0x41020000 _C89_CVERSION=0x41020000 _CC_CVERSION=0x41020000 _CXX_PVERSION=0x41020000 _C89_PVERSION=0x41020000 _CC_PVERSION=0x41020000'
|
||||
export COMPILE_LINK_ENVVAR='_CXX_CICC_VER}=0x41020000 _C89_CVERSION=0x41020000 _CC_CVERSION=0x41020000 _CXX_PVERSION=0x41020000 _C89_PVERSION=0x41020000 _CC_PVERSION=0x41020000'
|
||||
export _CXX_CVERSION=0x41020000 _C89_CVERSION=0x41020000 _CC_CVERSION=0x41020000 _CXX_PVERSION=0x41020000 _C89_PVERSION=0x41020000 _CC_PVERSION=0x41020000
|
||||
export LDFLAGS="-Wl,'compat=pm3'"
|
||||
export CFLAGS="-Wc,'target(zOSV1R2)'"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************
|
||||
* COPYRIGHT:
|
||||
* Copyright (c) 1997-2001, International Business Machines Corporation and
|
||||
* Copyright (c) 1997-2009, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
********************************************************************/
|
||||
/********************************************************************************
|
||||
|
@ -15,7 +15,7 @@
|
|||
#include "cintltst.h"
|
||||
|
||||
void addTestConvert(TestNode**);
|
||||
void addTestNewConvert(TestNode**);
|
||||
#include "nucnvtst.h"
|
||||
void addTestConvertErrorCallBack(TestNode** root);
|
||||
void addTestEuroRegression(TestNode** root);
|
||||
void addTestConverterFallBack(TestNode** root);
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "unicode/ustring.h"
|
||||
#include "unicode/ucol.h"
|
||||
#include "cmemory.h"
|
||||
#include "nucnvtst.h"
|
||||
|
||||
static void TestNextUChar(UConverter* cnv, const char* source, const char* limit, const int32_t results[], const char* message);
|
||||
static void TestNextUCharError(UConverter* cnv, const char* source, const char* limit, UErrorCode expected, const char* message);
|
||||
|
@ -50,6 +51,9 @@ static void TestLATIN1(void);
|
|||
static void TestSBCS(void);
|
||||
static void TestDBCS(void);
|
||||
static void TestMBCS(void);
|
||||
#if !UCONFIG_NO_LEGACY_CONVERSION && !UCONFIG_NO_FILE_IO
|
||||
static void TestICCRunout(void);
|
||||
#endif
|
||||
|
||||
#ifdef U_ENABLE_GENERIC_ISO_2022
|
||||
static void TestISO_2022(void);
|
||||
|
@ -85,6 +89,8 @@ static void TestJB5275_1(void);
|
|||
static void TestJitterbug6175(void);
|
||||
#endif
|
||||
|
||||
static void TestInBufSizes(void);
|
||||
|
||||
static void TestRoundTrippingAllUTF(void);
|
||||
static void TestConv(const uint16_t in[],
|
||||
int len,
|
||||
|
@ -92,7 +98,6 @@ static void TestConv(const uint16_t in[],
|
|||
const char* lang,
|
||||
char byteArr[],
|
||||
int byteArrLen);
|
||||
void addTestNewConvert(TestNode** root);
|
||||
|
||||
/* open a converter, using test data if it begins with '@' */
|
||||
static UConverter *my_ucnv_open(const char *cnv, UErrorCode *err);
|
||||
|
@ -257,6 +262,7 @@ void addTestNewConvert(TestNode** root)
|
|||
addTest(root, &TestSBCS, "tsconv/nucnvtst/TestSBCS");
|
||||
#if !UCONFIG_NO_FILE_IO
|
||||
addTest(root, &TestDBCS, "tsconv/nucnvtst/TestDBCS");
|
||||
addTest(root, &TestICCRunout, "tsconv/nucnvtst/TestICCRunout");
|
||||
#endif
|
||||
addTest(root, &TestMBCS, "tsconv/nucnvtst/TestMBCS");
|
||||
|
||||
|
@ -1490,7 +1496,7 @@ static void TestAmbiguous()
|
|||
0
|
||||
};
|
||||
UChar asciiResult[200], sjisResult[200];
|
||||
int32_t asciiLength = 0, sjisLength = 0, i;
|
||||
int32_t /*asciiLength = 0,*/ sjisLength = 0, i;
|
||||
const char *name;
|
||||
|
||||
/* enumerate all converters */
|
||||
|
@ -1530,7 +1536,7 @@ static void TestAmbiguous()
|
|||
return;
|
||||
}
|
||||
/* convert target from Latin-1 to Unicode */
|
||||
asciiLength = ucnv_toUChars(ascii_cnv, asciiResult, sizeof(asciiResult)/U_SIZEOF_UCHAR, target, (int32_t)strlen(target), &status);
|
||||
/*asciiLength =*/ ucnv_toUChars(ascii_cnv, asciiResult, sizeof(asciiResult)/U_SIZEOF_UCHAR, target, (int32_t)strlen(target), &status);
|
||||
if (U_FAILURE(status))
|
||||
{
|
||||
log_err("Failed to convert the Latin-1 string.\n");
|
||||
|
@ -1773,8 +1779,7 @@ TestSignatureDetection(){
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
static TestUTF7() {
|
||||
static void TestUTF7() {
|
||||
/* test input */
|
||||
static const uint8_t in[]={
|
||||
/* H - +Jjo- - ! +- +2AHcAQ */
|
||||
|
@ -1817,8 +1822,7 @@ static TestUTF7() {
|
|||
ucnv_close(cnv);
|
||||
}
|
||||
|
||||
void
|
||||
static TestIMAP() {
|
||||
static void TestIMAP() {
|
||||
/* test input */
|
||||
static const uint8_t in[]={
|
||||
/* H - &Jjo- - ! &- &2AHcAQ- \ */
|
||||
|
@ -1861,8 +1865,7 @@ static TestIMAP() {
|
|||
ucnv_close(cnv);
|
||||
}
|
||||
|
||||
void
|
||||
static TestUTF8() {
|
||||
static void TestUTF8() {
|
||||
/* test input */
|
||||
static const uint8_t in[]={
|
||||
0x61,
|
||||
|
@ -1927,8 +1930,7 @@ static TestUTF8() {
|
|||
ucnv_close(cnv);
|
||||
}
|
||||
|
||||
void
|
||||
static TestCESU8() {
|
||||
static void TestCESU8() {
|
||||
/* test input */
|
||||
static const uint8_t in[]={
|
||||
0x61,
|
||||
|
@ -1999,8 +2001,7 @@ static TestCESU8() {
|
|||
ucnv_close(cnv);
|
||||
}
|
||||
|
||||
void
|
||||
static TestUTF16() {
|
||||
static void TestUTF16() {
|
||||
/* test input */
|
||||
static const uint8_t in1[]={
|
||||
0xfe, 0xff, 0x4e, 0x00, 0xfe, 0xff
|
||||
|
@ -2058,8 +2059,7 @@ static TestUTF16() {
|
|||
ucnv_close(cnv);
|
||||
}
|
||||
|
||||
void
|
||||
static TestUTF16BE() {
|
||||
static void TestUTF16BE() {
|
||||
/* test input */
|
||||
static const uint8_t in[]={
|
||||
0x00, 0x61,
|
||||
|
@ -2169,8 +2169,7 @@ TestUTF16LE() {
|
|||
ucnv_close(cnv);
|
||||
}
|
||||
|
||||
void
|
||||
static TestUTF32() {
|
||||
static void TestUTF32() {
|
||||
/* test input */
|
||||
static const uint8_t in1[]={
|
||||
0x00, 0x00, 0xfe, 0xff, 0x00, 0x10, 0x0f, 0x00, 0x00, 0x00, 0xfe, 0xff
|
||||
|
@ -2632,6 +2631,60 @@ TestMBCS() {
|
|||
|
||||
}
|
||||
|
||||
#if !UCONFIG_NO_LEGACY_CONVERSION && !UCONFIG_NO_FILE_IO
|
||||
static void
|
||||
TestICCRunout() {
|
||||
/* { "ibm-1363", :bin{ a2aea2 }, "\u00a1\u001a", :intvector{ 0, 2 }, :int{1}, :int{0}, "\", "?", :bin{""} } */
|
||||
|
||||
const char *cnvName = "ibm-1363";
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
const uint8_t sourceData[] = { 0xa2, 0xae, 0xa2 };
|
||||
UChar expectUData[] = { 0x00a1, 0x001a };
|
||||
const uint8_t *source = sourceData;
|
||||
const uint8_t *sourceLim = sourceData+sizeof(sourceData);
|
||||
UChar targetBuf[256];
|
||||
UChar *target = targetBuf;
|
||||
UChar *targetLim = target+256;
|
||||
UChar c1, c2, c3;
|
||||
UConverter *cnv=ucnv_open(cnvName, &status);
|
||||
if(U_FAILURE(status)) {
|
||||
log_data_err("Unable to open %s converter: %s\n", cnvName, u_errorName(status));
|
||||
return;
|
||||
}
|
||||
|
||||
#if 0
|
||||
ucnv_toUnicode(cnv, &target, targetLim, &source, sourceLim, NULL, TRUE, &status);
|
||||
|
||||
log_info("After convert: target@%d, source@%d, status%s\n",
|
||||
target-targetBuf, source-sourceData, u_errorName(status));
|
||||
|
||||
if(U_FAILURE(status)) {
|
||||
log_err("Failed to convert: %s\n", u_errorName(status));
|
||||
} else {
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
c1=ucnv_getNextUChar(cnv, &source, sourceLim, &status);
|
||||
log_verbose("c1: U+%04X, source@%d, status %s\n", c1, source-sourceData, u_errorName(status));
|
||||
|
||||
c2=ucnv_getNextUChar(cnv, &source, sourceLim, &status);
|
||||
log_verbose("c2: U+%04X, source@%d, status %s\n", c2, source-sourceData, u_errorName(status));
|
||||
|
||||
c3=ucnv_getNextUChar(cnv, &source, sourceLim, &status);
|
||||
log_verbose("c3: U+%04X, source@%d, status %s\n", c3, source-sourceData, u_errorName(status));
|
||||
|
||||
if(status==U_INDEX_OUTOFBOUNDS_ERROR && c3==0xFFFF) {
|
||||
log_verbose("OK\n");
|
||||
} else {
|
||||
log_err("FAIL: c3 was not FFFF or err was not U_INDEXOUTOFBOUNDS_ERROR\n");
|
||||
}
|
||||
|
||||
ucnv_close(cnv);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef U_ENABLE_GENERIC_ISO_2022
|
||||
|
||||
static void
|
||||
|
@ -2701,7 +2754,7 @@ TestSmallTargetBuffer(const uint16_t* source, const UChar* sourceLimit,UConverte
|
|||
char *cTarget;
|
||||
const char *cTargetLimit;
|
||||
char *cBuf;
|
||||
UChar *uBuf,*test;
|
||||
UChar *uBuf; /*,*test;*/
|
||||
int32_t uBufSize = 120;
|
||||
int len=0;
|
||||
int i=2;
|
||||
|
@ -2749,7 +2802,7 @@ TestSmallTargetBuffer(const uint16_t* source, const UChar* sourceLimit,UConverte
|
|||
}while(cSource<cSourceLimit);
|
||||
|
||||
uSource = source;
|
||||
test =uBuf;
|
||||
/*test =uBuf;*/
|
||||
for(len=0;len<(int)(source - sourceLimit);len++){
|
||||
if(uBuf[len]!=uSource[len]){
|
||||
log_err("Expected : \\u%04X \t Got: \\u%04X\n",uSource[len],(int)uBuf[len]) ;
|
||||
|
@ -2817,7 +2870,7 @@ static void TestSmallSourceBuffer(const uint16_t* source, const UChar* sourceLim
|
|||
char *cTarget;
|
||||
const char *cTargetLimit;
|
||||
char *cBuf;
|
||||
UChar *uBuf,*test;
|
||||
UChar *uBuf; /*,*test;*/
|
||||
int32_t uBufSize = 120;
|
||||
int len=0;
|
||||
int i=2;
|
||||
|
@ -2871,7 +2924,7 @@ static void TestSmallSourceBuffer(const uint16_t* source, const UChar* sourceLim
|
|||
}while(cSource<cTarget);
|
||||
|
||||
uSource = source;
|
||||
test =uBuf;
|
||||
/*test =uBuf;*/
|
||||
for(;len<(int)(source - sourceLimit);len++){
|
||||
if(uBuf[len]!=uSource[len]){
|
||||
log_err("Expected : \\u%04X \t Got: \\u%04X\n",uSource[len],(int)uBuf[len]) ;
|
||||
|
@ -2884,14 +2937,14 @@ static void TestSmallSourceBuffer(const uint16_t* source, const UChar* sourceLim
|
|||
static void
|
||||
TestGetNextUChar2022(UConverter* cnv, const char* source, const char* limit,
|
||||
const uint16_t results[], const char* message){
|
||||
const char* s0;
|
||||
/* const char* s0; */
|
||||
const char* s=(char*)source;
|
||||
const uint16_t *r=results;
|
||||
UErrorCode errorCode=U_ZERO_ERROR;
|
||||
uint32_t c,exC;
|
||||
ucnv_reset(cnv);
|
||||
while(s<limit) {
|
||||
s0=s;
|
||||
/* s0=s; */
|
||||
c=ucnv_getNextUChar(cnv, &s, limit, &errorCode);
|
||||
if(errorCode==U_INDEX_OUTOFBOUNDS_ERROR) {
|
||||
break; /* no more significant input */
|
||||
|
@ -5221,7 +5274,7 @@ static void TestJitterbug255()
|
|||
const char *testBuffer = (const char *)testBytes;
|
||||
const char *testEnd = (const char *)testBytes + sizeof(testBytes);
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UChar32 result;
|
||||
/*UChar32 result;*/
|
||||
UConverter *cnv = 0;
|
||||
|
||||
cnv = ucnv_open("shift-jis", &status);
|
||||
|
@ -5231,7 +5284,7 @@ static void TestJitterbug255()
|
|||
}
|
||||
while (testBuffer != testEnd)
|
||||
{
|
||||
result = ucnv_getNextUChar (cnv, &testBuffer, testEnd , &status);
|
||||
/*result = */ucnv_getNextUChar (cnv, &testBuffer, testEnd , &status);
|
||||
if (U_FAILURE(status))
|
||||
{
|
||||
log_err("Failed to convert the next UChar for SJIS.\n");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************
|
||||
* COPYRIGHT:
|
||||
* Copyright (c) 1997-2001, International Business Machines Corporation and
|
||||
* Copyright (c) 1997-2009, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
********************************************************************/
|
||||
/********************************************************************************
|
||||
|
@ -18,6 +18,7 @@
|
|||
#include "cintltst.h"
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
static void TestInBufSizes(void);
|
||||
void addTestNewConvert(TestNode** root);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue