[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / OpenACC / acc-declare-validity.f90
blob5578d9afbc0d2d1658f0552482b8d34587ab62ab
1 ! RUN: %python %S/../test_errors.py %s %flang -fopenacc
3 ! Check OpenACC clause validity for the following construct and directive:
4 ! 2.13 Declare
6 module openacc_declare_validity
8 implicit none
10 real(8), dimension(10) :: aa, bb, ab, cc
12 !ERROR: At least one clause is required on the DECLARE directive
13 !$acc declare
15 !$acc declare create(aa, bb)
17 !$acc declare link(ab)
19 !$acc declare device_resident(cc)
21 !ERROR: COPYOUT clause is not allowed on the DECLARE directive in module declaration section
22 !$acc declare copyout(ab)
24 !ERROR: COPY clause is not allowed on the DECLARE directive in module declaration section
25 !$acc declare copy(ab)
27 !ERROR: PRESENT clause is not allowed on the DECLARE directive in module declaration section
28 !$acc declare present(ab)
30 !ERROR: DEVICEPTR clause is not allowed on the DECLARE directive in module declaration section
31 !$acc declare deviceptr(ab)
33 contains
35 subroutine sub1(cc, dd)
36 real(8) :: cc(:)
37 real(8) :: dd(:)
38 !$acc declare present(cc, dd)
39 end subroutine sub1
41 function fct1(ee, ff, gg, hh, ii)
42 integer :: fct1
43 real(8), intent(in) :: ee(:)
44 !$acc declare copyin(readonly: ee)
45 real(8) :: ff(:), hh(:), ii(:,:)
46 !$acc declare link(hh) device_resident(ii)
47 real(8), intent(out) :: gg(:)
48 !$acc declare copy(ff) copyout(gg)
49 end function fct1
51 subroutine sub2(cc)
52 real(8), dimension(*) :: cc
53 !ERROR: Assumed-size dummy arrays may not appear on the DECLARE directive
54 !$acc declare present(cc)
55 end subroutine sub2
57 end module openacc_declare_validity