summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/forall_14.f90
blob: a3fb3921de17a2b684fbbad526123629e4b30d5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
! { dg-do compile }
!
! PR fortran/46205
!
! Contributed by Jonathan Stott
!

program forallBug
  logical :: valid(4) = (/ .true., .true., .false., .true. /)
  real    :: vec(4)
  integer :: j

  ! This is an illegal statement.  It should read valid(j), not valid.
  forall (j = 1:4, valid) ! { dg-error "requires a scalar LOGICAL expression" }
     vec(j) = sin(2*3.14159/j)
  end forall
end program forallBug