OpenACC acc_on_device.
[official-gcc.git] / gcc / testsuite / gfortran.dg / goacc / acc_on_device-2-off.f95
blobcf2826475a3f4e0eecc04bd0d900613eaf336812
1 ! Have to enable optimizations, as otherwise builtins won't be expanded.
2 ! { dg-additional-options "-O -fdump-rtl-expand -fno-openacc" }
4 module openacc_kinds
5 implicit none
7 integer, parameter :: acc_device_kind = 4
9 end module openacc_kinds
11 module openacc
12 use openacc_kinds
13 implicit none
15 integer (acc_device_kind), parameter :: acc_device_host = 2
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
26 logical (4) function f ()
27 use openacc
28 implicit none
30 integer (4), parameter :: dev = 2
32 f = acc_on_device (dev)
33 return
34 end function f
36 ! Without -fopenacc, we're expecting one call.
37 ! { dg-final { scan-rtl-dump-times "\\\(call \[^\\n\]*\\\"acc_on_device" 1 "expand" } }
39 ! { dg-final { cleanup-rtl-dump "expand" } }