blob: 58e828e9d0b7a9ad1dd769af5e6ff68657f221bb [file] [edit]
! RUN: %python %S/test_modfile.py %s %flang_fc1
! Sanity check for CUDA Fortran attributes in module files
module m
attributes(device) dd
real, managed, allocatable :: md
real, pinned, allocatable :: mp
attributes(constant) cd
type dt
real, device, pointer :: dp
end type
contains
attributes(global) subroutine globsub(x,y,z)
real, value :: x
real, device :: y
real, managed :: z
end subroutine
attributes(host,device) real function foo(x)
foo = x + 1.
end function
attributes(host) subroutine hostsub(a)
integer, intent(out) :: a(14)
a = 99
end subroutine
end
!Expect: m.mod
!module m
!real(4),device::dd
!real(4),allocatable,managed::md
!real(4),allocatable,pinned::mp
!real(4),constant::cd
!type::dt
!real(4),pointer,device::dp
!end type
!contains
!attributes(global) subroutine globsub(x,y,z)
!real(4),value::x
!real(4),device::y
!real(4),managed::z
!end
!attributes(host,device) function foo(x)
!real(4)::x
!real(4)::foo
!end
!attributes(host)subroutinehostsub(a)
!integer(4),intent(out)::a(1_8:14_8)
!end
!end