OSDN Git Service

2011-01-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.fortran-torture / execute / arraysave.f90
1 ! Program to test arrays with the save attribute
2 program testarray
3    implicit none
4    integer, save, dimension (6, 5) :: a, b
5
6    a = 0
7    a(1, 1) = 42
8    a(6, 5) = 43
9    b(:,1:5) = a
10
11    call fn (a)
12 contains
13 subroutine fn (a)
14    implicit none
15    integer, dimension(1:, 1:) :: a
16    integer, dimension(2) :: b
17    
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
24