41 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenacc2 3subroutine implicitDeviceInSameFile(v)4 real, device :: v(10)5end6 7subroutine implicitNonDeviceInSameFile(v)8 real :: v(10)9end10 11program p12 real, device :: dev(10)13 real :: host(10)14 interface15 subroutine explicitDevice(v)16 real, device :: v(10)17 end18 subroutine explicitNonDevice(v)19 real :: v(10)20 end21 end interface22 !WARNING: Actual argument 'dev' with CUDA data attributes should be passed via an explicit interface [-Wcuda-usage]23 call implicit1(dev)24 call implicit2(host)25 !WARNING: Actual argument 'dev' with CUDA data attributes should be passed via an explicit interface [-Wcuda-usage]26 call implicitDeviceInSameFile(dev)27 !WARNING: If the procedure's interface were explicit, this reference would be in error [-Wknown-bad-implicit-interface]28 !BECAUSE: dummy argument 'v=' has ATTRIBUTES(DEVICE) but its associated actual argument has no CUDA data attribute29 call implicitDeviceInSameFile(host)30 !WARNING: If the procedure's interface were explicit, this reference would be in error [-Wknown-bad-implicit-interface]31 !BECAUSE: dummy argument 'v=' has no CUDA data attribute but its associated actual argument has ATTRIBUTES(DEVICE)32 call implicitNonDeviceInSameFile(dev)33 call implicitNonDeviceInSameFile(host)34 call explicitDevice(dev)35 !ERROR: dummy argument 'v=' has ATTRIBUTES(DEVICE) but its associated actual argument has no CUDA data attribute36 call explicitDevice(host)37 !ERROR: dummy argument 'v=' has no CUDA data attribute but its associated actual argument has ATTRIBUTES(DEVICE)38 call explicitNonDevice(dev)39 call explicitNonDevice(host)40end41