* gcc-interface/trans.c (Call_to_gnu): If this is a function call and
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / kernels-loop-data-2.f95
blob4c73606571ffe2575293f0fe9c36eddb5c3e215b
1 ! { dg-do run }
3 program main
4 implicit none
5 integer, parameter :: n = 1024
6 integer, dimension (0:n-1) :: a, b, c
7 integer :: i, ii
9 !$acc data copyout (a(0:n-1))
10 !$acc kernels present (a(0:n-1))
11 do i = 0, n - 1
12 a(i) = i * 2
13 end do
14 !$acc end kernels
15 !$acc end data
17 !$acc data copyout (b(0:n-1))
18 !$acc kernels present (b(0:n-1))
19 do i = 0, n -1
20 b(i) = i * 4
21 end do
22 !$acc end kernels
23 !$acc end data
25 !$acc data copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1))
26 !$acc kernels present (a(0:n-1), b(0:n-1), c(0:n-1))
27 do ii = 0, n - 1
28 c(ii) = a(ii) + b(ii)
29 end do
30 !$acc end kernels
31 !$acc end data
33 do i = 0, n - 1
34 if (c(i) .ne. a(i) + b(i)) call abort
35 end do
37 end program main