1 ! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenacc
4 real, managed, allocatable :: b(:,:)
5 integer, constant :: x = 1
10 module procedure addHost
11 module procedure addDevice
12 end interface operator (+)
14 attributes(global) subroutine kernel(a,b,c,n,m)
16 integer, intent(in) :: m
18 real, managed :: b(n,m)
20 attributes(device) subroutine devsub(a,n)
27 !ERROR: dummy argument 'm=' has ATTRIBUTES(DEVICE) but its associated actual argument has no CUDA data attribute
28 call kernel<<<1,32>>>(a,b,b,4,8)
29 !$acc parallel loop copy(c)
31 call devsub(c,4) ! not checked in OpenACC construct
34 attributes(global) subroutine sub1(x)
38 call sub1<<<1,1>>>(x) ! actual constant to device dummy
40 function addHost(a, b) result(c)
41 type(int), intent(in) :: a, b
44 attributes(device) function addDevice(a, b) result(c)
45 type(int), device :: c
46 type(int), intent(in) :: a ,b
47 end function addDevice
48 attributes(global) subroutine overload(c, a, b)
50 c = a+b ! ok resolve to addDevice
51 end subroutine overload