| 1 |
! { dg-do run } |
| 2 |
! { dg-options "-fdump-tree-original" } |
| 3 |
! |
| 4 |
! Check that copy loops to ensure contiguity of transpose result are |
| 5 |
! generated properly after fixing pr103390, and that it does not ICE. |
| 6 |
! This variant is for an intent(in) dummy argument so no copy-out |
| 7 |
! is needed, only copy-in. |
| 8 |
|
| 9 |
program p |
| 10 |
integer, pointer :: z(:,:) |
| 11 |
integer, target :: x(3,3) = reshape ([1, 2, 3, 4, 5, 6, 7, 8, 9], shape(x)) |
| 12 |
z => x |
| 13 |
call s(transpose(z)) |
| 14 |
contains |
| 15 |
subroutine s(x) bind(c) |
| 16 |
integer, contiguous, intent(in) :: x(:,:) |
| 17 |
end |
| 18 |
end |
| 19 |
|
| 20 |
! Expect 2 nested copy loops before the call to S. |
| 21 |
! { dg-final { scan-tree-dump-times "while \\(1\\)" 2 "original" } } |
| 22 |
|