diff options
author | thevenyp <thevenyp@280ebfd0-de03-0410-8827-d642c229c3f4> | 2009-01-12 16:01:14 +0000 |
---|---|---|
committer | thevenyp <thevenyp@280ebfd0-de03-0410-8827-d642c229c3f4> | 2009-01-12 16:01:14 +0000 |
commit | a2a583edfa2df66eff23e2ac0a87a5b97dbeebe3 (patch) | |
tree | 0e9ebe21815c190a384fa175fee98b2b408284d8 /tests/tprintf.c | |
parent | 112c80e4706651f014601c9dcf84d9f0c206a943 (diff) | |
download | mpfr-a2a583edfa2df66eff23e2ac0a87a5b97dbeebe3.tar.gz |
acinclude.m4: New macro MPFR_CHECK_PRINTF_SPEC looking for support of the "%jd", "%qd", and "%td" conversion specifications in printf and gmp_printf.
configure.in: Call MPFR_CHECK_PRINTF_SPEC when we can link against a suitable gmp library and run test programs at compile time, otherwise (for instance, when cross compiling), everything is enable by default.
vasprintf.c: Disable support for length modifiers not supported by libc's printf ('j' and 'q' for this time).
tests/tprintf.c, tests/tfprintf.c: Disable tests for length modifiers not supported by gmp_printf ('j', 'q', and 't' for this time).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@5801 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tprintf.c')
-rw-r--r-- | tests/tprintf.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/tprintf.c b/tests/tprintf.c index 849810e35..92b826a52 100644 --- a/tests/tprintf.c +++ b/tests/tprintf.c @@ -191,10 +191,14 @@ check_mixed () check_length (5, sz, 34, zu); check_vprintf ("a. %Pu, b. %c, c. %Lf, d. %Zi%Zn", prec, ch, ld, mpz, &mpz); check_length_with_cmp (6, mpz, 31, mpz_cmp_ui (mpz, 31), Zi); - check_vprintf ("%% a. %#.0RNg, b. %Qx%Rn, c. %td, d. %p", mpfr, mpq, &mpfr, - p, &i); + check_vprintf ("%% a. %#.0RNg, b. %Qx%Rn c. %p", mpfr, mpq, &mpfr, &i); check_length_with_cmp (7, mpfr, 16, mpfr_cmp_ui (mpfr, 16), Rg); +#ifndef NO_GMP_PRINTF_T + check_vprintf ("%% a. %RNg, b. %Qx, c. %td%tn", mpfr, mpq, p, &p); + check_length (8, p, 21, td); +#endif + #ifdef HAVE_LONG_LONG { long long llo = -1; @@ -207,7 +211,8 @@ check_mixed () } #endif -#ifdef HAVE_QUAD_T +#if defined(HAVE_QUAD_T) && !defined(NO_LIBC_PRINTF_Q)\ + && !defined(NO_GMP_PRINTF_Q) { quad_t q = -1; u_quad_t uq = 1; @@ -219,7 +224,8 @@ check_mixed () } #endif -#ifdef _MPFR_H_HAVE_INTMAX_T +#if defined(_MPFR_H_HAVE_INTMAX_T) && !defined(NO_LIBC_PRINTF_J)\ + && !defined(NO_GMP_PRINTF_J) { intmax_t im = -1; uintmax_t uim = 1; |