summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.fortran-torture/execute/select_1.f90
blob: 2fe5b6847d86badf662d9b0e44107b4117f9ce87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
! from PR 15962, we used to require constant expressions instead of
! initialization expressions in case-statements
function j(k)
integer :: k
integer :: j
integer, parameter :: i(2) = (/1,2/)

select case(k)
case (1:size(i))
    j = i(k)
case default
    j = 0
end select
end function

if (j(2).NE.2 .OR. j(11).NE.0) call abort()
end