1 ! RUN: %python %S/../test_errors.py %s %flang -fopenacc
3 ! Check OpenACC clause validity for the following construct and directive:
6 module openacc_declare_validity
10 real(8), dimension(10) :: aa
, bb
, ab
, cc
12 !ERROR: At least one clause is required on the DECLARE directive
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)
35 subroutine sub1(cc
, dd
)
38 !$acc declare present(cc, dd)
41 function fct1(ee
, ff
, gg
, hh
, ii
)
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)
52 real(8), dimension(*) :: cc
53 !ERROR: Assumed-size dummy arrays may not appear on the DECLARE directive
54 !$acc declare present(cc)
57 end module openacc_declare_validity