| 1 |
! { dg-do compile } |
| 2 |
|
| 3 |
module mymod |
| 4 |
implicit none (type, external) |
| 5 |
integer, target :: var(0:5) = [0,1,2,3,4,5] |
| 6 |
contains |
| 7 |
function foo (i) |
| 8 |
integer :: i |
| 9 |
integer, pointer :: foo |
| 10 |
foo => var(mod(i, 6)) |
| 11 |
end |
| 12 |
end module mymod |
| 13 |
|
| 14 |
program main |
| 15 |
use mymod |
| 16 |
implicit none |
| 17 |
|
| 18 |
type t |
| 19 |
integer :: x(0:64) |
| 20 |
integer :: y |
| 21 |
end type t |
| 22 |
type(t) :: dep2(0:64) |
| 23 |
integer :: dep1(0:64) |
| 24 |
|
| 25 |
integer arr(0:63) |
| 26 |
!$omp parallel |
| 27 |
!$omp master |
| 28 |
block |
| 29 |
integer :: i |
| 30 |
do i = 0, 63 |
| 31 |
! NB: Revoking foo (pointer returning function) as in 'foo(i)' is a variable in the Fortran sense |
| 32 |
!$omp task depend (iterator (j=i:i+1) , out : foo (j)) ! { dg-error "is not a variable" } |
| 33 |
arr(i) = i |
| 34 |
!!$omp end task |
| 35 |
!$omp task depend(iterator(i=1:5), source ) ! { dg-error "ITERATOR may not be combined with SOURCE" } |
| 36 |
!!$omp end task |
| 37 |
!$omp task affinity (iterator(i=1:5): a) depend(iterator(i=1:5), sink : x) ! { dg-error "SINK at .1. not permitted as dependence-type for this directive" } |
| 38 |
!!$omp end task |
| 39 |
|
| 40 |
end do |
| 41 |
end block |
| 42 |
!$omp end master |
| 43 |
!$omp end parallel |
| 44 |
end |