From: Nick Clifton Date: Thu, 21 Sep 2000 17:30:11 +0000 (+0000) Subject: Add extra tests (for modulos of very large dividends by very small divisors) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1d5d6f3f8c527645b078157e6c2b691a0538d598;p=gcc.git Add extra tests (for modulos of very large dividends by very small divisors) From-SVN: r36561 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d32659ba898..3ca1afe987f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2000-09-21 Nick Clifton + + * gcc.c-torture/execute/divmod-1.c (mod5): New function - perform + a signed long modulo operation. + (mod6): New funciton - perform an unsigned long modulo operation. + (main): Add tests for modulos of very large numbers by very small + dividends. + 2000-09-19 Kaveh R. Ghazi * g++.old-deja/g++.other/virtual8.C: Declare printf correctly. diff --git a/gcc/testsuite/gcc.c-torture/execute/divmod-1.c b/gcc/testsuite/gcc.c-torture/execute/divmod-1.c index ade019c884e..569c16efc0e 100644 --- a/gcc/testsuite/gcc.c-torture/execute/divmod-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/divmod-1.c @@ -50,6 +50,22 @@ mod4 (x, y) return x % y; } +signed long +mod5 (x, y) + signed long x; + signed long y; +{ + return x % y; +} + +unsigned long +mod6 (x, y) + unsigned long x; + unsigned long y; +{ + return x % y; +} + main () { if (div1 (-(1 << 7)) != 1 << 7) @@ -68,5 +84,10 @@ main () abort (); if (mod4 (-(1 << 15), -1) != 0) abort (); + if (mod5 (0x50000000, 2) != 0) + abort (); + if (mod6 (0x50000000, 2) != 0) + abort (); + exit (0); }