[Mono-bugs] [Bug 478479] New: New test_0_long_to_double_conversion is bogus
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Sat Feb 21 18:03:12 EST 2009
https://bugzilla.novell.com/show_bug.cgi?id=478479
Summary: New test_0_long_to_double_conversion is bogus
Classification: Mono
Product: Mono: Runtime
Version: SVN
Platform: PowerPC-64
OS/Version: openSUSE 10.3
Status: NEW
Severity: Normal
Priority: P5 - None
Component: misc
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: munroesj at us.ibm.com
QAContact: mono-bugs at lists.ximian.com
Found By: ---
User-Agent: Mozilla/5.0 (X11; U; Linux ppc64; en-US; rv:1.8.1.19)
Gecko/20081213 SUSE/2.0.0.19-0.1 Firefox/2.0.0.19
In mini/basic-float.cs the test:
static int test_0_long_to_double_conversion ()
{
long l = 9223372036854775807L;
long conv = (long)((double)l);
if (conv != -9223372036854775808l)
return 1;
return 0;
}
is invalid because long value 9223372036854775807 requires 63-bits but a
IEEE754 long only carries 53 bits precision. So the conversion will round to
9223372036854775808. When thins is converted back the result can not be
represented in a long and the result is implementation dependent.
>From the PowerISA-2.05 description of fctid[z]
If the operand in FRB is greater than 2**63 - 1, then FRT
is set to 0x7FFF_FFFF_FFFF_FFFF. If the operand in
FRB is less than -263, then FRT is set to
0x8000_0000_0000_0000.
Net on conversion overflow; the instruction returns the largest representable
64-bit integer for the sign.
This is allowed in IEEE754.
This test assumes that conversion returns the largest negative value regardless
of the original sign.
Reproducible: Always
Steps to Reproduce:
1. autogen
2. make
3. make check
Actual Results:
Test run:
image=/home/sjmunroe/src/mono-ppc/mono-svn64/mono/mono/mini/basic-float.exe,
opts=
Test 'test_0_long_to_double_conversion' failed result (got 1, expected 0).
Results: total tests: 32, failed: 1, cfailed: 0 (pass: 96.88%)
Elapsed time: 0.003475 secs (0.001053, 0.002422), Code size: 9312
Expected Results:
Test run:
image=/home/sjmunroe/src/mono-ppc/mono-svn64/mono/mono/mini/basic-float.exe,
opts=
Results: total tests: 32, all pass.
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list