diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/scalarize2.f90')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/scalarize2.f90 | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/scalarize2.f90 b/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/scalarize2.f90 new file mode 100644 index 000000000..608c051d3 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/scalarize2.f90 @@ -0,0 +1,24 @@ +! Program to test the scalarizer +program testarray + implicit none + integer, dimension (:, :), allocatable :: a, b + integer n + + allocate(a(6, 5), b(6, 5)) + a = 0 + do n = 1, 5 + a(4, n) = n + end do + + b(:, 5:1:-1) = a + a(1:5, 2) = a(4, :) + 1 + + ! The following expression should cause loop reordering + a(:, 2:4) = a(:, 1:3) + + do n = 1, 5 + if (a(n, 3) .ne. (n + 1)) call abort + if (b(4, n) .ne. (6 - n)) call abort + end do +end program + |