1 ! RUN: %python %S/../test_errors.py %s %flang -fopenacc
3 ! Check OpenACC clause validity for the following construct and directive:
6 program openacc_cache_validity
11 real(8), dimension(10) :: arr
16 integer, parameter :: N
= 256
17 real(8), dimension(N
, N
) :: aa
19 type(atype
), dimension(10) :: ta
20 real(8), dimension(N
) :: a
23 !$acc cache(a(1:2,3:4))
25 !$acc cache(readonly: a, aa)
26 !$acc cache(readonly: a(i), aa(i, i))
28 !$acc cache(ta(1:2)%arr)
29 !$acc cache(ta(1:2)%arr(1:4))
31 !ERROR: Only array element or subarray are allowed in CACHE directive
32 !$acc cache(ta(1:2)%s)
34 !ERROR: Only array element or subarray are allowed in CACHE directive
37 !ERROR: Only array element or subarray are allowed in CACHE directive
40 !ERROR: Only array element or subarray are allowed in CACHE directive
43 end program openacc_cache_validity