1 ! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
4 ! Check OpenACC clause validity for the following construct and directive:
7 program openacc_cache_validity
12 real(8), dimension(10) :: arr
17 integer, parameter :: N
= 256
18 real(8), dimension(N
, N
) :: aa
20 type(atype
), dimension(10) :: ta
21 real(8), dimension(N
) :: a
24 !$acc cache(a(1:2,3:4))
26 !$acc cache(readonly: a, aa)
27 !$acc cache(readonly: a(i), aa(i, i))
29 !$acc cache(ta(1:2)%arr)
30 !$acc cache(ta(1:2)%arr(1:4))
32 !ERROR: Only array element or subarray are allowed in CACHE directive
33 !$acc cache(ta(1:2)%s)
35 !ERROR: Only array element or subarray are allowed in CACHE directive
38 !ERROR: Only array element or subarray are allowed in CACHE directive
41 !ERROR: Only array element or subarray are allowed in CACHE directive
44 end program openacc_cache_validity