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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [intrinsic_dotprod.f90] - Blame information for rev 698

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

Line No. Rev Author Line
1 695 jeremybenn
! Program to test the DOT_PRODUCT intrinsic
2
program testforall
3
   implicit none
4
   integer, dimension (3) :: a
5
   integer, dimension (3) :: b
6
   real, dimension(3) :: c
7
   real r
8
   complex, dimension (2) :: z1
9
   complex, dimension (2) :: z2
10
   complex z
11
 
12
   a = (/1, 2, 3/);
13
   b = (/4, 5, 6/);
14
   c = (/4, 5, 6/);
15
 
16
   if (dot_product(a, b) .ne. 32) call abort
17
 
18
   r = dot_product(a, c)
19
   if (abs(r - 32.0) .gt. 0.001) call abort
20
 
21
   z1 = (/(1.0, 2.0), (2.0, 3.0)/)
22
   z2 = (/(3.0, 4.0), (4.0, 5.0)/)
23
   z = dot_product (z1, z2)
24
   if (abs (z - (34.0, -4.0)) .gt. 0.001) call abort
25
end program

powered by: WebSVN 2.1.0

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