aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-09-21 17:30:11 +0000
committerNick Clifton <nickc@gcc.gnu.org>2000-09-21 17:30:11 +0000
commit1d5d6f3f8c527645b078157e6c2b691a0538d598 (patch)
tree19da08fda0f7d83137e3d3aa0e3c57f9d3478df8 /gcc
parent968d9d61d4ca0d85f93ace5476aa0aa4513ae3e6 (diff)
downloadgcc-1d5d6f3f8c527645b078157e6c2b691a0538d598.zip
gcc-1d5d6f3f8c527645b078157e6c2b691a0538d598.tar.gz
gcc-1d5d6f3f8c527645b078157e6c2b691a0538d598.tar.bz2
Add extra tests (for modulos of very large dividends by very small divisors)
From-SVN: r36561
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog8
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/divmod-1.c21
2 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d32659b..3ca1afe9 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2000-09-21 Nick Clifton <nickc@redhat.com>
+
+ * 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 <ghazi@caip.rutgers.edu>
* 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 ade019c..569c16e 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);
}