diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2010-11-09 12:37:23 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2010-11-09 12:37:23 +0000 |
commit | f51c17b39de9c16ef1e942030e01f7fc8e40d0ca (patch) | |
tree | 8ec965e54c7df7042f669a6f9e99f09ac8ec1eff | |
parent | ec1893fdb090418ebc93acfa59760e7fe14a2c4f (diff) | |
download | mpfr-f51c17b39de9c16ef1e942030e01f7fc8e40d0ca.tar.gz |
[tests/tset_si.c] Added testcase for problem fixed in r7236.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7254 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | tests/tset_si.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/tset_si.c b/tests/tset_si.c index 5e4768103..df1193cc0 100644 --- a/tests/tset_si.c +++ b/tests/tset_si.c @@ -122,6 +122,27 @@ test_macros (void) mpfr_clears (x[0], x[1], x[2], (mpfr_ptr) 0); } +static void +test_macros_keyword (void) +{ + mpfr_t x; + unsigned long i; + + mpfr_init2 (x, 64); +#define MKN 0x1000000 +#define long short + mpfr_set_ui (x, MKN, MPFR_RNDN); +#undef long + i = mpfr_get_ui (x, MPFR_RNDN); + if (i != MKN) + { + printf ("Error in test_macros_keyword: expected 0x%lx, got 0x%lx.\n", + (unsigned long) MKN, i); + exit (1); + } + mpfr_clear (x); +} + /* FIXME: Comparing against mpfr_get_si/ui is not ideal, it'd be better to have all tests examine the bits in mpfr_t for what should come out. */ @@ -429,6 +450,7 @@ main (int argc, char *argv[]) test_2exp (); test_macros (); + test_macros_keyword (); tests_end_mpfr (); return 0; } |