OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [intrinsic_dotprod.f90] - Rev 378

Go to most recent revision | Compare with Previous | Blame | View Log

! Program to test the DOT_PRODUCT intrinsic
program testforall
   implicit none
   integer, dimension (3) :: a
   integer, dimension (3) :: b
   real, dimension(3) :: c
   real r
   complex, dimension (2) :: z1
   complex, dimension (2) :: z2
   complex z

   a = (/1, 2, 3/);
   b = (/4, 5, 6/);
   c = (/4, 5, 6/);

   if (dot_product(a, b) .ne. 32) call abort

   r = dot_product(a, c)
   if (abs(r - 32.0) .gt. 0.001) call abort

   z1 = (/(1.0, 2.0), (2.0, 3.0)/)
   z2 = (/(3.0, 4.0), (4.0, 5.0)/)
   z = dot_product (z1, z2)
   if (abs (z - (34.0, -4.0)) .gt. 0.001) call abort
end program

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.