[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / OpenACC / acc-cache-validity.f90
blob9afdd6def21fdef4bad057cf3c655231a0ddd41c
1 ! RUN: %python %S/../test_errors.py %s %flang -fopenacc
3 ! Check OpenACC clause validity for the following construct and directive:
4 ! 2.10 Cache
6 program openacc_cache_validity
8 implicit none
10 type atype
11 real(8), dimension(10) :: arr
12 real(8) :: s
13 end type atype
15 integer :: i
16 integer, parameter :: N = 256
17 real(8), dimension(N, N) :: aa
18 type(atype) :: t
19 type(atype), dimension(10) :: ta
20 real(8), dimension(N) :: a
22 !$acc cache(a(i))
23 !$acc cache(a(1:2,3:4))
24 !$acc cache(a)
25 !$acc cache(readonly: a, aa)
26 !$acc cache(readonly: a(i), aa(i, i))
27 !$acc cache(t%arr)
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
35 !$acc cache(i)
37 !ERROR: Only array element or subarray are allowed in CACHE directive
38 !$acc cache(t%s)
40 !ERROR: Only array element or subarray are allowed in CACHE directive
41 !$acc cache(/i/)
43 end program openacc_cache_validity