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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
!
3
! PR fortran/33231
4
!
5
! Elemental function:
6
! Intent OUT/INOUT dummy: Actual needs to be an array
7
! if any actual is an array
8
!
9
program prog
10
implicit none
11
integer :: i, j(2)
12
call sub(i,1,2) ! OK, only scalar
13
call sub(j,1,2) ! OK, scalar IN, array OUT
14
call sub(j,[1,2],3) ! OK, scalar & array IN, array OUT
15
call sub(j,[1,2],[1,2]) ! OK, all arrays
16
 
17
call sub(i,1,2) ! OK, only scalar
18
call sub(i,[1,2],3) ! { dg-error "is a scalar" }
19
call sub(i,[1,2],[1,2]) ! { dg-error "is a scalar" }
20
contains
21
elemental subroutine sub(a,b,c)
22
  integer :: func, a, b, c
23
  intent(in) :: b,c
24
  intent(out) :: a
25
  a = b +c
26
end subroutine sub
27
end program prog

powered by: WebSVN 2.1.0

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