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

Subscribers

People subscribed via source and target branches