1! PR90030.
2! Test if the array data associated with c is properly aligned
3! on the accelerator.  If it is not, this program will crash.
4
5! This is also included from '../libgomp.fortran/pr90030.f90'.
6
7! { dg-do run }
8
9program routine_align_main
10  implicit none
11  integer :: i, n
12  real*8, dimension(:), allocatable :: c
13
14  n = 10
15
16  allocate (c(n))
17
18  !$omp target map(to: n) map(from: c(1:n))
19  !$acc parallel copyin(n) copyout(c(1:n))
20  do i = 1, n
21     c(i) = i
22  enddo
23  !$acc end parallel
24  !$omp end target
25
26  do i = 1, n
27     if (c(i) .ne. i) stop i
28  enddo
29end program routine_align_main
30