| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-fopenmp -fdump-tree-original" } |
| 3 |
|
| 4 |
! PR fortran/78260 |
| 5 |
|
| 6 |
integer function f1() |
| 7 |
implicit none |
| 8 |
|
| 9 |
f1 = 0 |
| 10 |
|
| 11 |
!$omp task depend(inout:f1) |
| 12 |
!$omp end task |
| 13 |
|
| 14 |
!$omp task depend(inout:f1) |
| 15 |
!$omp end task |
| 16 |
end function f1 |
| 17 |
|
| 18 |
integer function f2() |
| 19 |
implicit none |
| 20 |
dimension :: f2(1) |
| 21 |
|
| 22 |
f2(1) = 0 |
| 23 |
|
| 24 |
!$omp task depend(inout:f2) |
| 25 |
!$omp end task |
| 26 |
|
| 27 |
!$omp task depend(inout:f2) |
| 28 |
!$omp end task |
| 29 |
end function f2 |
| 30 |
|
| 31 |
integer function f3() result(res) |
| 32 |
implicit none |
| 33 |
dimension :: res(1) |
| 34 |
|
| 35 |
res(1) = 0 |
| 36 |
|
| 37 |
!$omp task depend(inout:res) |
| 38 |
!$omp end task |
| 39 |
|
| 40 |
!$omp task depend(inout:res) |
| 41 |
!$omp end task |
| 42 |
end function f3 |
| 43 |
|
| 44 |
integer function f4() result(res) |
| 45 |
implicit none |
| 46 |
allocatable :: res |
| 47 |
dimension :: res(:) |
| 48 |
|
| 49 |
res = [0] |
| 50 |
|
| 51 |
!$omp task depend(inout:res) |
| 52 |
!$omp end task |
| 53 |
|
| 54 |
!$omp task depend(inout:res) |
| 55 |
!$omp end task |
| 56 |
end function f4 |
| 57 |
|
| 58 |
subroutine sub() |
| 59 |
implicit none |
| 60 |
integer, allocatable :: arr(:) |
| 61 |
|
| 62 |
arr = [3] |
| 63 |
|
| 64 |
!$omp task depend(inout:arr) |
| 65 |
!$omp end task |
| 66 |
|
| 67 |
!$omp task depend(inout:arr) |
| 68 |
!$omp end task |
| 69 |
end subroutine sub |
| 70 |
|
| 71 |
! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(inout:__result_f1\\)" 2 "original" } } |
| 72 |
! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(inout:\\*__result.0\\)" 4 "original" } } |
| 73 |
! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(inout:\\*\\(integer\\(kind=4\\)\\\[0:\\\] \\* restrict\\) __result->data\\)" 2 "original" } } |
| 74 |
! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(inout:\\*\\(integer\\(kind=4\\)\\\[0:\\\] \\* restrict\\) arr.data\\)" 2 "original" } } |