gcc/testsuite/gfortran.dg/goacc/pr104717.f90
raw| 1 | ! Extracted from 'libgomp.oacc-fortran/privatized-ref-2.f90'. |
| 2 | |
| 3 | ! { dg-additional-options "-O1 -fstack-arrays -fipa-pta" } |
| 4 | |
| 5 | program main |
| 6 | implicit none (type, external) |
| 7 | integer :: j |
| 8 | integer, allocatable :: A(:) |
| 9 | |
| 10 | A = [(3*j, j=1, 10)] |
| 11 | call foo (A, size(A)) |
| 12 | deallocate (A) |
| 13 | contains |
| 14 | subroutine foo (array, nn) |
| 15 | integer :: i, nn |
| 16 | integer :: array(nn) |
| 17 | |
| 18 | !$acc parallel copyout(array) |
| 19 | array = [(-i, i = 1, nn)] |
| 20 | !$acc end parallel |
| 21 | end subroutine foo |
| 22 | end |