| 1 |
! { dg-additional-options -Wuninitialized } |
| 2 |
|
| 3 |
! Purpose of this testcase (from the commit log): |
| 4 |
! This patch fixes lowering of derived-type mappings which select elements |
| 5 |
! of arrays of derived types, and similar. These would previously lead |
| 6 |
! to ICEs. |
| 7 |
|
| 8 |
! This testcase does not show any uninitialized warnings when compiled with -O |
| 9 |
! (as done). For -O0, see testcase file 'array-with-dt-1a.f90'. |
| 10 |
|
| 11 |
type t |
| 12 |
integer, allocatable :: A(:,:) |
| 13 |
end type t |
| 14 |
|
| 15 |
type(t), allocatable :: b(:) |
| 16 |
|
| 17 |
! Remark: Semantically, the following line requires that 'b' |
| 18 |
! is already present on the device. |
| 19 |
|
| 20 |
!$acc update host(b) |
| 21 |
|
| 22 |
! Remark: Semantically, the following lines require that b is allocated |
| 23 |
! and present on the device. The last line also requires the same for 'A'. |
| 24 |
|
| 25 |
!$acc update host(b(:)) |
| 26 |
!$acc update host(b(1)%A) |
| 27 |
!$acc update host(b(1)%A(:,:)) |
| 28 |
end |