Skip gnat.dg/prot7.adb on hppa.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / optional-data-copyin-by-value.f90
blob8e842980863857dd4d7dadc327fb0734a4d2a126
1 ! Test OpenACC data regions with optional arguments passed by value.
3 ! { dg-do run }
5 program test
6 implicit none
8 integer :: res
10 if (foo(27) .ne. 27) stop 1
11 if (foo(16, 18) .ne. 288) stop 2
12 contains
13 function foo(x, y)
14 integer, value :: x
15 integer, value, optional :: y
16 integer :: res, foo
18 !$acc data copyin(x, y) copyout(res)
19 !$acc parallel
20 res = x
21 if (present(y)) then
22 res = res * y
23 end if
24 !$acc end parallel
25 !$acc end data
27 foo = res
28 end function foo
29 end program test