30 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12 3module dev4 integer, device :: syncthreads5 6contains7 8 attributes(device) subroutine sub1()9 syncthreads = 1 ! syncthreads not overwritten by cudadevice10 end subroutine11 12 attributes(global) subroutine sub2()13!ERROR: 'threadfence' is use-associated from module 'cudadevice' and cannot be re-declared14 integer :: threadfence15 end subroutine16 17 attributes(host,device) subroutine sub3()18 if (on_device()) then19 print*, 'on device'20 else21 print*, 'on host'22 end if23 end subroutine24 25 attributes(grid_global) subroutine sub4()26 call threadfence()27 end subroutine28end module29 30