1*e8eb52d1SValentin Clement (バレンタイン クレメン)! RUN: bbc -emit-hlfir -fcuda -gpu=managed %s -o - | FileCheck %s 2*e8eb52d1SValentin Clement (バレンタイン クレメン) 3*e8eb52d1SValentin Clement (バレンタイン クレメン)module matching 4*e8eb52d1SValentin Clement (バレンタイン クレメン) interface host_and_device 5*e8eb52d1SValentin Clement (バレンタイン クレメン) module procedure sub_host 6*e8eb52d1SValentin Clement (バレンタイン クレメン) module procedure sub_device 7*e8eb52d1SValentin Clement (バレンタイン クレメン) end interface 8*e8eb52d1SValentin Clement (バレンタイン クレメン) 9*e8eb52d1SValentin Clement (バレンタイン クレメン) interface all 10*e8eb52d1SValentin Clement (バレンタイン クレメン) module procedure sub_host 11*e8eb52d1SValentin Clement (バレンタイン クレメン) module procedure sub_device 12*e8eb52d1SValentin Clement (バレンタイン クレメン) module procedure sub_managed 13*e8eb52d1SValentin Clement (バレンタイン クレメン) module procedure sub_unified 14*e8eb52d1SValentin Clement (バレンタイン クレメン) end interface 15*e8eb52d1SValentin Clement (バレンタイン クレメン) 16*e8eb52d1SValentin Clement (バレンタイン クレメン) interface all_without_managed 17*e8eb52d1SValentin Clement (バレンタイン クレメン) module procedure sub_host 18*e8eb52d1SValentin Clement (バレンタイン クレメン) module procedure sub_device 19*e8eb52d1SValentin Clement (バレンタイン クレメン) module procedure sub_unified 20*e8eb52d1SValentin Clement (バレンタイン クレメン) end interface 21*e8eb52d1SValentin Clement (バレンタイン クレメン) 22*e8eb52d1SValentin Clement (バレンタイン クレメン)contains 23*e8eb52d1SValentin Clement (バレンタイン クレメン) subroutine sub_host(a) 24*e8eb52d1SValentin Clement (バレンタイン クレメン) integer :: a(:) 25*e8eb52d1SValentin Clement (バレンタイン クレメン) end 26*e8eb52d1SValentin Clement (バレンタイン クレメン) 27*e8eb52d1SValentin Clement (バレンタイン クレメン) subroutine sub_device(a) 28*e8eb52d1SValentin Clement (バレンタイン クレメン) integer, device :: a(:) 29*e8eb52d1SValentin Clement (バレンタイン クレメン) end 30*e8eb52d1SValentin Clement (バレンタイン クレメン) 31*e8eb52d1SValentin Clement (バレンタイン クレメン) subroutine sub_managed(a) 32*e8eb52d1SValentin Clement (バレンタイン クレメン) integer, managed :: a(:) 33*e8eb52d1SValentin Clement (バレンタイン クレメン) end 34*e8eb52d1SValentin Clement (バレンタイン クレメン) 35*e8eb52d1SValentin Clement (バレンタイン クレメン) subroutine sub_unified(a) 36*e8eb52d1SValentin Clement (バレンタイン クレメン) integer, unified :: a(:) 37*e8eb52d1SValentin Clement (バレンタイン クレメン) end 38*e8eb52d1SValentin Clement (バレンタイン クレメン)end module 39*e8eb52d1SValentin Clement (バレンタイン クレメン) 40*e8eb52d1SValentin Clement (バレンタイン クレメン)program m 41*e8eb52d1SValentin Clement (バレンタイン クレメン) use matching 42*e8eb52d1SValentin Clement (バレンタイン クレメン) 43*e8eb52d1SValentin Clement (バレンタイン クレメン) integer, allocatable :: actual_host(:) 44*e8eb52d1SValentin Clement (バレンタイン クレメン) 45*e8eb52d1SValentin Clement (バレンタイン クレメン) allocate(actual_host(10)) 46*e8eb52d1SValentin Clement (バレンタイン クレメン) 47*e8eb52d1SValentin Clement (バレンタイン クレメン) call host_and_device(actual_host) ! Should resolve to sub_device 48*e8eb52d1SValentin Clement (バレンタイン クレメン) call all(actual_host) ! Should resolved to unified 49*e8eb52d1SValentin Clement (バレンタイン クレメン) call all_without_managed(actual_host) ! Should resolved to managed 50*e8eb52d1SValentin Clement (バレンタイン クレメン)end 51*e8eb52d1SValentin Clement (バレンタイン クレメン) 52*e8eb52d1SValentin Clement (バレンタイン クレメン)! CHECK: fir.call @_QMmatchingPsub_device 53*e8eb52d1SValentin Clement (バレンタイン クレメン)! CHECK: fir.call @_QMmatchingPsub_managed 54*e8eb52d1SValentin Clement (バレンタイン クレメン)! CHECK: fir.call @_QMmatchingPsub_unified 55*e8eb52d1SValentin Clement (バレンタイン クレメン) 56