| 1 |
! { dg-do run } |
| 2 |
! { dg-options "-fdump-tree-original" } |
| 3 |
! |
| 4 |
! Check that copy loops to ensure contiguity of the result of an elemental |
| 5 |
! array-valued expression are generated properly after fixing pr103390, |
| 6 |
! and that it does not ICE. |
| 7 |
|
| 8 |
program p |
| 9 |
integer, pointer :: z(:) |
| 10 |
integer :: a(3) = [1, 2, 3]; |
| 11 |
integer :: b(3) = [4, 5, 6]; |
| 12 |
call s(a + b); |
| 13 |
contains |
| 14 |
subroutine s(x) bind(c) |
| 15 |
integer, contiguous :: x(:) |
| 16 |
end |
| 17 |
end |
| 18 |
|
| 19 |
! We only expect one loop before the call, to fill in the contiguous |
| 20 |
! temporary. No copy-out is needed since the temporary is effectively |
| 21 |
! an rvalue. |
| 22 |
! { dg-final { scan-tree-dump-times "while \\(1\\)" 1 "original" } } |
| 23 |
|
| 24 |
! It should not emit code to check the contiguous property. |
| 25 |
! { dg-final { scan-tree-dump-not "contiguous\\.\[0-9\]+" "original" } } |
| 26 |
|