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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [elemental_args_check_1.f90] - Blame information for rev 694

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! PR fortran/33343
3
!
4
! Check conformance of array actual arguments to
5
! elemental function.
6
!
7
! Contributed by Mikael Morin  
8
!
9
      module geometry
10
      implicit none
11
      integer, parameter :: prec = 8
12
      integer, parameter :: length = 10
13
      contains
14
      elemental function Mul(a, b)
15
      real(kind=prec) :: a
16
      real(kind=prec) :: b, Mul
17
      intent(in)      :: a, b
18
      Mul = a * b
19
      end function Mul
20
 
21
      pure subroutine calcdAcc2(vectors, angles)
22
      real(kind=prec),      dimension(:)          :: vectors
23
      real(kind=prec), dimension(size(vectors),2) :: angles
24
      intent(in) :: vectors, angles
25
      real(kind=prec), dimension(size(vectors)) :: ax
26
      real(kind=prec), dimension(size(vectors),2) :: tmpAcc
27
      tmpAcc(1,:) = Mul(angles(1,1:2),ax(1)) ! Ok
28
      tmpAcc(:,1) = Mul(angles(:,1),ax)      ! OK
29
      tmpAcc(:,:) = Mul(angles(:,:),ax) ! { dg-error "Incompatible ranks in elemental procedure" }
30
      end subroutine calcdAcc2
31
      end module geometry

powered by: WebSVN 2.1.0

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