[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / OpenACC / acc-cache-validity.f90
blob30c68ef3e179558209cba69f540e869b17f26129
1 ! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
2 ! REQUIRES: shell
4 ! Check OpenACC clause validity for the following construct and directive:
5 ! 2.10 Cache
7 program openacc_cache_validity
9 implicit none
11 type atype
12 real(8), dimension(10) :: arr
13 real(8) :: s
14 end type atype
16 integer :: i
17 integer, parameter :: N = 256
18 real(8), dimension(N, N) :: aa
19 type(atype) :: t
20 type(atype), dimension(10) :: ta
21 real(8), dimension(N) :: a
23 !$acc cache(a(i))
24 !$acc cache(a(1:2,3:4))
25 !$acc cache(a)
26 !$acc cache(readonly: a, aa)
27 !$acc cache(readonly: a(i), aa(i, i))
28 !$acc cache(t%arr)
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
36 !$acc cache(i)
38 !ERROR: Only array element or subarray are allowed in CACHE directive
39 !$acc cache(t%s)
41 !ERROR: Only array element or subarray are allowed in CACHE directive
42 !$acc cache(/i/)
44 end program openacc_cache_validity