PR target/84064
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / combined-directives-1.f90
blob94100b22163493acf7c56162d3fe446707638884
1 ! This test exercises combined directives.
3 ! { dg-do run }
5 program main
6 integer, parameter :: n = 32
7 real :: a(n), b(n);
8 integer :: i
10 do i = 1, n
11 a(i) = 1.0
12 b(i) = 0.0
13 end do
15 !$acc parallel loop copy (a(1:n)) copy (b(1:n))
16 do i = 1, n
17 b(i) = 2.0
18 a(i) = a(i) + b(i)
19 end do
21 do i = 1, n
22 if (a(i) .ne. 3.0) call abort
24 if (b(i) .ne. 2.0) call abort
25 end do
27 !$acc kernels loop copy (a(1:n)) copy (b(1:n))
28 do i = 1, n
29 b(i) = 3.0;
30 a(i) = a(i) + b(i)
31 end do
33 do i = 1, n
34 if (a(i) .ne. 6.0) call abort
36 if (b(i) .ne. 3.0) call abort
37 end do
39 end program main