PR c++/86342 - -Wdeprecated-copy and system headers.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / lib-14.f90
blobeb0206ccce1e0902cb421868e5f066a4a7ff49ec
1 ! Exercise the data movement runtime library functions on non-shared memory
2 ! targets.
4 ! { dg-do run { target openacc_nvidia_accel_selected } }
6 program main
7 use openacc
8 implicit none
10 integer, parameter :: N = 256
11 integer, allocatable :: h(:)
12 integer :: i
14 allocate (h(N))
16 do i = 1, N
17 h(i) = i
18 end do
20 call acc_present_or_copyin (h)
22 if (acc_is_present (h) .neqv. .TRUE.) call abort
24 call acc_copyout (h)
26 if (acc_is_present (h) .neqv. .FALSE.) call abort
28 do i = 1, N
29 if (h(i) /= i) call abort
30 end do
32 do i = 1, N
33 h(i) = i + i
34 end do
36 call acc_pcopyin (h, sizeof (h))
38 if (acc_is_present (h) .neqv. .TRUE.) call abort
40 call acc_copyout (h)
42 if (acc_is_present (h) .neqv. .FALSE.) call abort
44 do i = 1, N
45 if (h(i) /= i + i) call abort
46 end do
48 call acc_create (h)
50 if (acc_is_present (h) .neqv. .TRUE.) call abort
52 !$acc parallel loop
53 do i = 1, N
54 h(i) = i
55 end do
56 !$end acc parallel
58 call acc_copyout (h)
60 if (acc_is_present (h) .neqv. .FALSE.) call abort
62 do i = 1, N
63 if (h(i) /= i) call abort
64 end do
66 call acc_present_or_create (h, sizeof (h))
68 if (acc_is_present (h) .neqv. .TRUE.) call abort
70 call acc_delete (h)
72 if (acc_is_present (h) .neqv. .FALSE.) call abort
74 call acc_pcreate (h)
76 if (acc_is_present (h) .neqv. .TRUE.) call abort
78 call acc_delete (h)
80 if (acc_is_present (h) .neqv. .FALSE.) call abort
82 end program