1! Have to enable optimizations, as otherwise builtins won't be expanded.
2! { dg-additional-options "-O -fdump-rtl-expand" }
3
4module openacc_kinds
5  implicit none
6
7  integer, parameter :: acc_device_kind = 4
8
9end module openacc_kinds
10
11module 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
24end module openacc
25
26logical (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
34end function f
35
36! With -fopenacc, we're expecting the builtin to be expanded, so no calls.
37! TODO: not working.
38! { dg-final { scan-rtl-dump-times "\\\(call \[^\\n\]* acc_on_device" 0 "expand" { xfail *-*-* } } }
39
40