61 lines · plain
1! RUN: %flang_fc1 -x cuda -fdebug-unparse %s | FileCheck %s2 3module matching4 interface sub5 module procedure sub_host6 module procedure sub_device7 module procedure sub_managed8 module procedure sub_unified9 end interface10 11 interface12 subroutine ignore(a)13 !dir$ ignore_tkr(d) a14 integer, managed :: a(:)15 end subroutine16 end interface17 18contains19 subroutine sub_host(a)20 integer :: a(:)21 end22 23 subroutine sub_device(a)24 integer, device :: a(:)25 end26 27 subroutine sub_managed(a)28 integer, managed :: a(:)29 end30 31 subroutine sub_unified(a)32 integer, unified :: a(:)33 end34end module35 36program m37 use matching38 39 integer, pinned, allocatable :: a(:)40 integer, managed, allocatable :: b(:)41 integer, unified, allocatable :: u(:)42 integer, device :: d(10)43 logical :: plog44 allocate(a(100), pinned = plog)45 allocate(b(200))46 allocate(u(100))47 48 call sub(a) ! Should resolve to sub_host49 call sub(b) ! Should resolve to sub_managed50 call sub(u) ! Should resolve to sub_unified51 call sub(d) ! Should resolve to sub_device52 53 call ignore(a)54end55 56! CHECK: CALL sub_host57! CHECK: CALL sub_managed58! CHECK: CALL sub_unified59! CHECK: CALL sub_device60! CHECK: CALL ignore61