| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-fopenacc -fdump-tree-original" } |
| 3 |
! { dg-require-effective-target fopenacc } |
| 4 |
|
| 5 |
! PR fortran/78260 |
| 6 |
|
| 7 |
! Loosely related to PR fortran/94120 |
| 8 |
|
| 9 |
module m |
| 10 |
implicit none |
| 11 |
integer :: n = 0 |
| 12 |
contains |
| 13 |
integer function f1() |
| 14 |
!$acc declare present(f1) |
| 15 |
!$acc kernels copyin(f1) |
| 16 |
f1 = 5 |
| 17 |
!$acc end kernels |
| 18 |
end function f1 |
| 19 |
integer function g1() result(g1res) |
| 20 |
!$acc declare present(g1res) |
| 21 |
!$acc kernels copyin(g1res) |
| 22 |
g1res = 5 |
| 23 |
!$acc end kernels |
| 24 |
end function g1 |
| 25 |
end module m |
| 26 |
! { dg-final { scan-tree-dump-times "#pragma acc data map\\(force_present:__result_f1\\)" 1 "original" } } |
| 27 |
! { dg-final { scan-tree-dump-times "#pragma acc kernels map\\(to:__result_f1\\)" 1 "original" } } |
| 28 |
! { dg-final { scan-tree-dump-times "#pragma acc data map\\(force_present:g1res\\)" 1 "original" } } |
| 29 |
! { dg-final { scan-tree-dump-times "#pragma acc kernels map\\(to:g1res\\)" 1 "original" } } |