| 1 |
! Test valid usage of the OpenACC 'declare' directive. |
| 2 |
|
| 3 |
! { dg-additional-options "-fdump-tree-original" } |
| 4 |
|
| 5 |
module mod_a |
| 6 |
implicit none |
| 7 |
integer :: a |
| 8 |
!$acc declare create (a) |
| 9 |
end module |
| 10 |
|
| 11 |
module mod_b |
| 12 |
implicit none |
| 13 |
integer :: b |
| 14 |
!$acc declare copyin (b) |
| 15 |
end module |
| 16 |
|
| 17 |
module mod_d |
| 18 |
implicit none |
| 19 |
integer :: d |
| 20 |
!$acc declare device_resident (d) |
| 21 |
end module |
| 22 |
|
| 23 |
module mod_e |
| 24 |
implicit none |
| 25 |
integer :: e |
| 26 |
!$acc declare link (e) |
| 27 |
end module |
| 28 |
|
| 29 |
subroutine sub1 |
| 30 |
use mod_a |
| 31 |
use mod_b |
| 32 |
use mod_d |
| 33 |
use mod_e |
| 34 |
end subroutine sub1 |
| 35 |
|
| 36 |
program test |
| 37 |
use mod_a |
| 38 |
use mod_b |
| 39 |
use mod_d |
| 40 |
use mod_e |
| 41 |
|
| 42 |
! { dg-final { scan-tree-dump {(?n)#pragma acc data map\(force_alloc:d\) map\(force_to:b\) map\(force_alloc:a\)$} original } } |
| 43 |
end program test |
| 44 |
|
| 45 |
! { dg-final { scan-tree-dump-times {#pragma acc data} 1 original } } |