]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gfortran.fortran-torture/execute/test_slice.f90
Merge tree-ssa-20020619-branch into mainline.
[thirdparty/gcc.git] / gcc / testsuite / gfortran.fortran-torture / execute / test_slice.f90
1 ! Program to test handling of reduced rank array sections. This uncovered
2 ! bugs in simplify_shape and the scalarization of array sections.
3 program test_slice
4 implicit none
5
6 real (kind = 8), dimension(2, 2, 2) :: x
7 real (kind = 8) :: min, max
8
9 x = 1.0
10 if (minval(x(1, 1:2, 1:1)) .ne. 1.0) call abort ()
11 if (maxval(x(1, 1:2, 1:1)) .ne. 1.0) call abort ()
12 if (any (shape(x(1, 1:2, 1:1)) .ne. (/2, 1/))) call abort ()
13
14 if (any (shape(x(1, 1:2, 1)) .ne. (/2/))) call abort ()
15 if (any (shape(x(1:1, 1:2, 1:1)) .ne. (/1, 2, 1/))) call abort ()
16
17 end program test_slice