Debian Codegraph @

gcc/testsuite/gfortran.dg/array_constructor_58.f90

raw
1 !{ dg-do run }
2
3 ! Contributed by Federico Perini <[email protected]>
4 ! Check that PR fortran/119106 is fixed.
5
6 program char_param_array
7 implicit none
8 character, parameter :: p(5) = ['1','2','3','4','5']
9 character, save :: n(5) = ['1','2','3','4','5']
10 integer :: i(10), j
11
12 i = 4
13 if (any([(n(i(j)),j=1,10)] /= '4')) stop 1 ! OK
14 if (any([(p(i(j)),j=1,10)] /= '4')) stop 2 ! used to runtime out-of-bounds error
15
16 end program char_param_array
17