1! Test derived types with subarrays
2
3! { dg-do run }
4
5  implicit none
6  type dtype
7     integer :: a, b, c
8  end type dtype
9  integer, parameter :: n = 100
10  integer i
11  type (dtype), dimension(n) :: d
12
13  !$acc data copy(d(1:n))
14  !$acc parallel loop
15  do i = 1, n
16     d(i)%a = i
17     d(i)%b = i-1
18     d(i)%c = i+1
19  end do
20  !$acc end data
21
22  do i = 1, n
23     if (d(i)%a /= i) stop 1
24     if (d(i)%b /= i-1) stop 2
25     if (d(i)%c /= i+1) stop 3
26  end do
27end program
28
29