mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 15:36:49 +00:00
49 lines
1.0 KiB
Plaintext
49 lines
1.0 KiB
Plaintext
! 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
|
|
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)::dd
|
|
!attributes(device) dd
|
|
!real(4),allocatable::md
|
|
!attributes(managed) md
|
|
!real(4),allocatable::mp
|
|
!attributes(pinned) mp
|
|
!real(4)::cd
|
|
!attributes(constant) cd
|
|
!contains
|
|
!attributes(global) subroutine globsub(x,y,z)
|
|
!real(4),value::x
|
|
!real(4)::y
|
|
!attributes(device) y
|
|
!real(4)::z
|
|
!attributes(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
|