c-family: Enable -fpermissive for C and ObjC
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / kernels-independent.f90
blob5a47aca2dba2ccf267f166458467dbf2744c4b54
1 ! { dg-do run }
2 ! { dg-additional-options "-cpp" }
4 #define N (1024 * 512)
6 subroutine foo (a, b, c)
7 integer, parameter :: n = N
8 integer, dimension (n) :: a
9 integer, dimension (n) :: b
10 integer, dimension (n) :: c
11 integer i, ii
13 do i = 1, n
14 a(i) = i * 2;
15 end do
17 do i = 1, n
18 b(i) = i * 4;
19 end do
21 !$acc kernels copyin (a(1:n), b(1:n)) copyout (c(1:n))
22 !$acc loop independent
23 do ii = 1, n
24 c(ii) = a(ii) + b(ii)
25 end do
26 !$acc end kernels
28 do i = 1, n
29 if (c(i) .ne. a(i) + b(i)) stop 1
30 end do
32 end subroutine
34 program main
35 integer, parameter :: n = N
36 integer :: a(n)
37 integer :: b(n)
38 integer :: c(n)
40 call foo (a, b, c)
42 end program main