summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_shape.f90
blob: e1c5f7b4ba15c636b24492f94c190d4edc959579 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
! Program to test the shape intrinsic
program testbounds
   implicit none
   real, dimension(:, :), allocatable :: a
   integer, dimension(2) :: j
   integer i

   allocate (a(3:8, 6:7))

   j = shape (a);
   if (any (j .ne. (/ 6, 2 /))) call abort

   call test(a)
contains

subroutine test (a)
   real, dimension (1:, 1:) :: a

   if (any (shape (a) .ne. (/ 6, 2 /))) call abort
end subroutine
end program