| 1 |
! Have to enable optimizations, as otherwise builtins won't be expanded. |
| 2 |
! { dg-additional-options "-O -fdump-rtl-expand -fno-openacc" } |
| 3 |
|
| 4 |
module openacc_kinds |
| 5 |
implicit none |
| 6 |
|
| 7 |
integer, parameter :: acc_device_kind = 4 |
| 8 |
|
| 9 |
end module openacc_kinds |
| 10 |
|
| 11 |
module openacc |
| 12 |
use openacc_kinds |
| 13 |
implicit none |
| 14 |
|
| 15 |
integer (acc_device_kind), parameter :: acc_device_host = 2 |
| 16 |
|
| 17 |
interface |
| 18 |
function acc_on_device (dev) |
| 19 |
use openacc_kinds |
| 20 |
logical (4) :: acc_on_device |
| 21 |
integer (acc_device_kind), intent (in) :: dev |
| 22 |
end function acc_on_device |
| 23 |
end interface |
| 24 |
end module openacc |
| 25 |
|
| 26 |
logical (4) function f () |
| 27 |
use openacc |
| 28 |
implicit none |
| 29 |
|
| 30 |
integer (4), parameter :: dev = 2 |
| 31 |
|
| 32 |
f = acc_on_device (dev) |
| 33 |
return |
| 34 |
end function f |
| 35 |
|
| 36 |
! Without -fopenacc, we're expecting one call. |
| 37 |
! { dg-final { scan-rtl-dump-times "\\\(call \[^\\n\]* acc_on_device" 1 "expand" } } |
| 38 |
|