summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/array_constructor_50.f90
blob: 843031fa37086025f68fd7e85434c987dbeef369 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
! { dg-do run }
! PR 71795 - wrong result when putting an array constructor
! instide an iterator.
     program test

     implicit none
     integer :: i,n
     logical, dimension(1) :: ra
     logical :: rs
     integer, allocatable :: a(:)

     allocate ( a(1) )

     n = 1
     a = 2

     ra = (/ (any(a(i).eq.(/1,2,3/)) ,i=1,n) /)
     if (.not. all(ra)) STOP 1
     rs = any ( (/ (any(a(i).eq.(/1,2,3/)) ,i=1,n) /) )
     if (.not. rs) STOP 2
   end program test