From: nickc Date: Fri, 10 Nov 2000 19:27:35 +0000 (+0000) Subject: Add test of unsigned long long multuiple and accumulate. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2b9f72c43a08c499dbad0c9be96b5b91f36b4a43;p=thirdparty%2Fgcc.git Add test of unsigned long long multuiple and accumulate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37375 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6553d1e0c759..ba3494a18bc1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2000-11-10 Nick Clifton + + * gcc.c-torture/execute/20001108-1.c: Add test of unsigned long + long multuiple and accumulate. + 2000-11-09 Richard Henderson * gcc.dg/sequence-pt-1.c: Cast from pointer to integer diff --git a/gcc/testsuite/gcc.c-torture/execute/20001108-1.c b/gcc/testsuite/gcc.c-torture/execute/20001108-1.c index 35756fd142c9..a2a325534016 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20001108-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20001108-1.c @@ -1,14 +1,24 @@ long long -poly (long long sum, long x) +signed_poly (long long sum, long x) { sum += (long long) (long) sum * (long long) x; return sum; } +unsigned long long +unsigned_poly (unsigned long long sum, unsigned long x) +{ + sum += (unsigned long long) (unsigned long) sum * (unsigned long long) x; + return sum; +} + int main (void) { - if (poly (2LL, 3) != 8LL) + if (signed_poly (2LL, -3) != -4LL) + abort (); + + if (unsigned_poly (2ULL, 3) != 8ULL) abort (); exit (0);