PR rtl-optimization/82913
[official-gcc.git] / gcc / testsuite / gfortran.fortran-torture / execute / arraysave.f90
blob94b234bd5120910ff7050948c68fb8c479cdb3bd
1 ! Program to test arrays with the save attribute
2 program testarray
3 implicit none
4 integer, save, dimension (6, 5) :: a, b
6 a = 0
7 a(1, 1) = 42
8 a(6, 5) = 43
9 b(:,1:5) = a
11 call fn (a)
12 contains
13 subroutine fn (a)
14 implicit none
15 integer, dimension(1:, 1:) :: a
16 integer, dimension(2) :: b
18 b = ubound (a)
19 if (any (b .ne. (/6, 5/))) call abort
20 if (a(1, 1) .ne. 42) call abort
21 if (a(6, 5) .ne. 43) call abort
22 end subroutine
23 end program