| 1 |
! { dg-do run } |
| 2 |
! { dg-skip-if "" { *-*-* } { "-O0" } { "" } } |
| 3 |
! { dg-additional-options "-ftree-loop-linear" } |
| 4 |
|
| 5 |
! Program to test the scalarizer |
| 6 |
program testarray |
| 7 |
implicit none |
| 8 |
integer, dimension (6, 5) :: a, b |
| 9 |
integer n |
| 10 |
|
| 11 |
a = 0 |
| 12 |
do n = 1, 5 |
| 13 |
a(4, n) = n |
| 14 |
end do |
| 15 |
|
| 16 |
b(:, 5:1:-1) = a |
| 17 |
a(1:5, 2) = a(4, :) + 1 |
| 18 |
|
| 19 |
! The following expression should cause loop reordering |
| 20 |
a(:, 2:4) = a(:, 1:3) |
| 21 |
|
| 22 |
do n = 1, 5 |
| 23 |
if (a(n, 3) .ne. (n + 1)) STOP 1 |
| 24 |
if (b(4, n) .ne. (6 - n)) STOP 2 |
| 25 |
end do |
| 26 |
end program |