summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2020-06-13 23:40:57 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2020-06-13 23:40:57 +0000
commit9d5158c2648dd211a3802b4ece5ab50685e9e7b5 (patch)
tree810a940c64790962cd4de05ff190351054de6c44 /tests
parentfba7c93a92e5a9140c9a307924ff6a33042b673f (diff)
downloadmpfr-9d5158c2648dd211a3802b4ece5ab50685e9e7b5.tar.gz
[tests/tset_ld.c] In a test specific to x86 extended precision, in case
of incorrect result, detect whether Valgrind is used and one gets the result obtained with Valgrind due to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890215 https://bugs.kde.org/show_bug.cgi?id=421262 (long double behaves as double); in this case, output a message without an error since Valgrind is the only cause of the miscalculation. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@14023 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests')
-rw-r--r--tests/tset_ld.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/tset_ld.c b/tests/tset_ld.c
index 16fe30bb9..23a82e106 100644
--- a/tests/tset_ld.c
+++ b/tests/tset_ld.c
@@ -480,6 +480,22 @@ bug_20160907 (void)
/* mp is 2^e rounded up, thus should be >= 2^e */
if (mpfr_cmp_ui_2exp (mp, 1, e) < 0)
{
+ if (tests_run_within_valgrind () && MPFR_IS_ZERO (mp))
+ {
+ /* Since this is not a bug in MPFR and it is just caused by
+ Valgrind, let's output a message and skip the remaining
+ part of the test without an error. Note that the message
+ will be not be visible via "make check".
+ Note that the other tests do not fail probably because
+ long double has the same behavior as double (which is
+ allowed by the C standard), but here this is a test that
+ is specific to x86 extended precision. */
+ printf
+ ("Error in bug_20160907 due to a bug in Valgrind.\n"
+ "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890215\n"
+ "https://bugs.kde.org/show_bug.cgi?id=421262\n");
+ break;
+ }
printf ("Error, expected value >= 2^(%ld)\n", e);
printf ("got "); mpfr_dump (mp);
exit (1);