summaryrefslogtreecommitdiff
path: root/tests/tadd.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2003-10-06 15:52:25 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2003-10-06 15:52:25 +0000
commitd495702c3ae3ab8d45147b9b647d988364206ce2 (patch)
tree6932a8507ee088da290712cb03efe8e82b17c998 /tests/tadd.c
parenta927fbd495443d0d69179d79ef842f148dbf57b6 (diff)
downloadmpfr-d495702c3ae3ab8d45147b9b647d988364206ce2.tar.gz
fixed bug in allocation for in-place operation
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2479 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tadd.c')
-rw-r--r--tests/tadd.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/tadd.c b/tests/tadd.c
index af4e719b6..ab21f9f28 100644
--- a/tests/tadd.c
+++ b/tests/tadd.c
@@ -584,6 +584,21 @@ check_nans (void)
mpfr_clear (s);
}
+static void
+check_alloc (void)
+{
+ mpfr_t a;
+
+ mpfr_init2 (a, 10000);
+ mpfr_set_prec (a, 53);
+ mpfr_set_ui (a, 15236, GMP_RNDN);
+ mpfr_add (a, a, a, GMP_RNDN);
+ mpfr_mul (a, a, a, GMP_RNDN);
+ mpfr_div (a, a, a, GMP_RNDN);
+ mpfr_sub (a, a, a, GMP_RNDN);
+ mpfr_clear (a);
+}
+
int
main (int argc, char *argv[])
{
@@ -593,6 +608,7 @@ main (int argc, char *argv[])
tests_start_mpfr ();
mpfr_test_init ();
+ check_alloc ();
check_nans ();
check_inexact ();
check_case_1b ();