brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 222ff2a Raw
42 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12 3! Test case 1: Device arrays with ignore_tkr(c)4subroutine test_device_arrays()5  interface bar6    subroutine bar1(a)7!dir$ ignore_tkr(c) a8      real :: a(..)9!@cuf attributes(device) :: a10    end subroutine11  end interface12 13  integer :: n = 10, k = 214  real, device :: a(10), b(10), c(10)15  16  call bar(a(1:n))     ! Should not warn about contiguity17  call bar(b(1:n:k))   ! Should not warn about contiguity18  call bar(c(1:n:2))   ! Should not warn about contiguity19end subroutine20 21! Test case 2: Managed arrays with ignore_tkr(c)22subroutine test_managed_arrays()23  interface bar24    subroutine bar1(a)25!dir$ ignore_tkr(c) a26      real :: a(..)27!@cuf attributes(device) :: a28    end subroutine29  end interface30 31  integer :: n = 10, k = 232  real, managed :: a(10), b(10), c(10)33  34  call bar(a(1:n))     ! Should not warn about contiguity35  call bar(b(1:n:k))   ! Should not warn about contiguity36  call bar(c(1:n:2))   ! Should not warn about contiguity37end subroutine38 39program main40  call test_device_arrays()41  call test_managed_arrays()42end program