Merge ~liushuyu-011/ubuntu/+source/icu:ubuntu/devel into ubuntu/+source/icu:ubuntu/devel

Proposed by Zixing Liu
Status: Merged
Merge reported by: Zixing Liu
Merged at revision: c79b2f1bce78bed3b207144430a139f32ebe2d1c
Proposed branch: ~liushuyu-011/ubuntu/+source/icu:ubuntu/devel
Merge into: ubuntu/+source/icu:ubuntu/devel
Diff against target: 153 lines (+131/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/disable-precision-fpmath-tests-on-i386.patch (+123/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Gianfranco Costamagna (community) Approve
git-ubuntu import Pending
Review via email: mp+451395@code.launchpad.net

Description of the change

This merge proposal adds a patch to disable float-point math tests in icu on i386 architecture.

Intel i386/486/586 x87 registers only have 80-bit precision, while the tests assume IEEE 754R 128-bit precision.

Note that this patch will not affect the situation when SSE math is
used. In this case, the macro added in this patch will correctly enable those
tests.

To post a comment you must log in.
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

Hello, I sponsored, but I fail to see a link to a failed build log, and to why this has regressed only now, and not before.

review: Approve
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 08be3e9..fa26cb2 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+icu (72.1-3ubuntu3) mantic; urgency=medium
7+
8+ * d/p/disable-precision-fpmath-tests-on-i386.patch: add a patch to disable
9+ precision checking tests on i386 where an imprecise FPU hardware is used
10+
11+ -- Zixing Liu <zixing.liu@canonical.com> Thu, 14 Sep 2023 15:01:17 -0600
12+
13 icu (72.1-3ubuntu2) lunar; urgency=medium
14
15 * d/p/test-canonical-ids.patch: update TestCanonicalIDs to match latest
16diff --git a/debian/patches/disable-precision-fpmath-tests-on-i386.patch b/debian/patches/disable-precision-fpmath-tests-on-i386.patch
17new file mode 100644
18index 0000000..8cc6803
19--- /dev/null
20+++ b/debian/patches/disable-precision-fpmath-tests-on-i386.patch
21@@ -0,0 +1,123 @@
22+Description: Disable fpmath tests on i386
23+ Intel i386/486/586 x87 registers only have 80-bit precision,
24+ while the tests assume IEEE 754R 128-bit precision.
25+ We have to disable those tests due to no alternative workaround
26+ is available.
27+Author: Zixing Liu <zixing.liu@canonical.com>
28+Forwarded: no
29+Last-Update: 2023-09-14
30+
31+Index: icu/source/test/intltest/dcfmapts.cpp
32+===================================================================
33+--- icu.orig/source/test/intltest/dcfmapts.cpp
34++++ icu/source/test/intltest/dcfmapts.cpp
35+@@ -861,8 +861,10 @@ void IntlTestDecimalFormatAPI::TestFixed
36+ df->formatToDecimalQuantity(fable, fd, status);
37+ assertSuccess(WHERE, status);
38+ ASSERT_EQUAL(22, fd.getPluralOperand(PLURAL_OPERAND_V));
39++#ifndef UPRV_IMPRECISE_FPMATH
40+ ASSERT_EQUAL(3456789012345678900LL, fd.getPluralOperand(PLURAL_OPERAND_F));
41+ ASSERT_EQUAL(34567890123456789LL, fd.getPluralOperand(PLURAL_OPERAND_T));
42++#endif
43+ ASSERT_EQUAL(12, fd.getPluralOperand(PLURAL_OPERAND_I));
44+ ASSERT_EQUAL(false, fd.hasIntegerValue());
45+ ASSERT_EQUAL(false, fd.isNegative());
46+@@ -873,9 +875,11 @@ void IntlTestDecimalFormatAPI::TestFixed
47+ df->formatToDecimalQuantity(fable, fd, status);
48+ assertSuccess(WHERE, status);
49+ ASSERT_EQUAL(22, fd.getPluralOperand(PLURAL_OPERAND_V));
50++#ifndef UPRV_IMPRECISE_FPMATH
51+ ASSERT_EQUAL(1234567890123456789LL, fd.getPluralOperand(PLURAL_OPERAND_F));
52+ ASSERT_EQUAL(1234567890123456789LL, fd.getPluralOperand(PLURAL_OPERAND_T));
53+ ASSERT_EQUAL(345678901234567890LL, fd.getPluralOperand(PLURAL_OPERAND_I));
54++#endif
55+ ASSERT_EQUAL(false, fd.hasIntegerValue());
56+ ASSERT_EQUAL(false, fd.isNegative());
57+
58+@@ -968,9 +972,11 @@ void IntlTestDecimalFormatAPI::TestFixed
59+ ASSERT_EQUAL(2, fd.getPluralOperand(PLURAL_OPERAND_V));
60+ ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_F));
61+ ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_T));
62++#ifndef UPRV_IMPRECISE_FPMATH
63+ // note: going through DigitList path to FixedDecimal, which is trimming
64+ // int64_t fields to 18 digits. See ticket Ticket #10374
65+ ASSERT_EQUAL(223372036854775807LL, fd.getPluralOperand(PLURAL_OPERAND_I));
66++#endif
67+ ASSERT_EQUAL(true, fd.hasIntegerValue());
68+ ASSERT_EQUAL(false, fd.isNegative());
69+
70+Index: icu/source/test/intltest/intltest.h
71+===================================================================
72+--- icu.orig/source/test/intltest/intltest.h
73++++ icu/source/test/intltest/intltest.h
74+@@ -29,6 +29,10 @@ U_NAMESPACE_USE
75+ #pragma map(IntlTest::log( const UnicodeString &message ),"logos390")
76+ #endif
77+
78++#if defined(__i386) && __SIZEOF_FLOAT80__ < 16
79++#define UPRV_IMPRECISE_FPMATH 1
80++#endif
81++
82+ //-----------------------------------------------------------------------------
83+ //convenience classes to ease porting code that uses the Java
84+ //string-concatenation operator (moved from findword test by rtg)
85+Index: icu/source/test/intltest/msfmrgts.cpp
86+===================================================================
87+--- icu.orig/source/test/intltest/msfmrgts.cpp
88++++ icu/source/test/intltest/msfmrgts.cpp
89+@@ -773,9 +773,11 @@ void MessageFormatRegressionTest::Test41
90+ // newobjs now equals {new Double(3.1)}
91+ if (newobjs == NULL) {
92+ dataerrln("Error calling MessageFormat::parse");
93++#ifndef UPRV_IMPRECISE_FPMATH
94+ } else {
95+ if (newobjs[0].getDouble() != 3.1)
96+ errln( UnicodeString("newobjs[0] = ") + newobjs[0].getDouble());
97++#endif
98+ }
99+
100+ delete [] objs;
101+Index: icu/source/test/intltest/numbertest_api.cpp
102+===================================================================
103+--- icu.orig/source/test/intltest/numbertest_api.cpp
104++++ icu/source/test/intltest/numbertest_api.cpp
105+@@ -3819,9 +3819,11 @@ void NumberFormatterApiTest::roundingInc
106+ // Precision::increment(5.00000).withMinFraction(2) 'precision-increment/5.00'
107+ // ...
108+
109++#ifndef UPRV_IMPRECISE_FPMATH
110+ char expected[256];
111+ snprintf(expected, 256, pattern, increment);
112+ assertEquals(message, expected, skeleton.c_str());
113++#endif
114+ }
115+ }
116+ }
117+Index: icu/source/test/intltest/numfmtst.cpp
118+===================================================================
119+--- icu.orig/source/test/intltest/numfmtst.cpp
120++++ icu/source/test/intltest/numfmtst.cpp
121+@@ -147,7 +147,9 @@ void NumberFormatTest::runIndexedTest( i
122+ TESTCASE_AUTO(TestNumberingSystems);
123+ TESTCASE_AUTO(TestSpaceParsing);
124+ TESTCASE_AUTO(TestMultiCurrencySign);
125++#ifndef UPRV_IMPRECISE_FPMATH
126+ TESTCASE_AUTO(TestCurrencyFormatForMixParsing);
127++#endif
128+ TESTCASE_AUTO(TestMismatchedCurrencyFormatFail);
129+ TESTCASE_AUTO(TestDecimalFormatCurrencyParse);
130+ TESTCASE_AUTO(TestCurrencyIsoPluralFormat);
131+Index: icu/source/test/intltest/numrgts.cpp
132+===================================================================
133+--- icu.orig/source/test/intltest/numrgts.cpp
134++++ icu/source/test/intltest/numrgts.cpp
135+@@ -2634,6 +2634,9 @@ void NumberFormatRegressionTest::Test424
136+ if (failure(status, "DecimalFormat ct", Locale::getUS())) {
137+ return;
138+ }
139++#ifdef UPRV_IMPRECISE_FPMATH
140++ return;
141++#endif
142+
143+ UnicodeString str;
144+ FieldPosition pos;
145diff --git a/debian/patches/series b/debian/patches/series
146index 3051e6f..7834df1 100644
147--- a/debian/patches/series
148+++ b/debian/patches/series
149@@ -1,3 +1,4 @@
150 icudata-stdlibs.patch
151 ICU-22198.patch
152 test-canonical-ids.patch
153+disable-precision-fpmath-tests-on-i386.patch

Subscribers

People subscribed via source and target branches