OSDN Git Service

2012-01-30 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / dim_range_1.f90
1 ! { dg-do compile }
2 ! PR 44693 - check for invalid dim even in functions.
3 ! Based on a test case by Dominique d'Humieres.
4 subroutine test1(esss,Ix,Iyz, n)
5   real(kind=kind(1.0d0)), dimension(n), intent(out) :: esss
6   real(kind=kind(1.0d0)), dimension(n,n,n) :: sp
7   real(kind=kind(1.0d0)), dimension(n,n) :: Ix,Iyz
8   esss = sum(Ix * Iyz, 0) ! { dg-error "is not a valid dimension index" }
9   esss = sum(Ix * Iyz, 1)
10   esss = sum(Ix * Iyz, 2)
11   esss = sum(Ix * Iyz, 3) ! { dg-error "is not a valid dimension index" }
12   sp = spread (ix * iyz, 0, n) ! { dg-error "is not a valid dimension index" }
13   sp = spread (ix * iyz, 1, n)
14   sp = spread (ix * iyz, 2, n)
15   sp = spread (ix * iyz, 3, n)
16   sp = spread (ix * iyz, 4, n) ! { dg-error "is not a valid dimension index" }
17 end subroutine