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
, ac
, ad
, ae
, af
, cc
, dd
12 !ERROR: At least one clause is required on the DECLARE directive
15 !$acc declare create(aa, bb)
17 !WARNING: 'aa' in the CREATE clause is already present in the same clause in this module
18 !$acc declare create(aa)
20 !$acc declare link(ab)
22 !$acc declare device_resident(cc)
24 !ERROR: COPYOUT clause is not allowed on the DECLARE directive in module declaration section
25 !$acc declare copyout(ac)
27 !ERROR: COPY clause is not allowed on the DECLARE directive in module declaration section
28 !$acc declare copy(af)
30 !ERROR: PRESENT clause is not allowed on the DECLARE directive in module declaration section
31 !$acc declare present(ad)
33 !ERROR: DEVICEPTR clause is not allowed on the DECLARE directive in module declaration section
34 !$acc declare deviceptr(ae)
36 !ERROR: The ZERO modifier is not allowed for the CREATE clause on the DECLARE directive
37 !$acc declare create(zero: dd)
39 !ERROR: 'bb' in the COPYIN clause is already present in another CREATE clause in this module
40 !$acc declare copyin(bb)
44 subroutine sub1(cc
, dd
)
47 !$acc declare present(cc, dd)
48 !ERROR: 'cc' in the CREATE clause is already present in another PRESENT clause in this module
49 !$acc declare create(cc)
52 function fct1(ee
, ff
, gg
, hh
, ii
)
54 real(8), intent(in
) :: ee(:)
55 !$acc declare copyin(readonly: ee)
56 real(8) :: ff(:), hh(:), ii(:,:)
57 !$acc declare link(hh) device_resident(ii)
58 real(8), intent(out
) :: gg(:)
59 !$acc declare copy(ff) copyout(gg)
63 real(8), dimension(*) :: cc
64 !ERROR: Assumed-size dummy arrays may not appear on the DECLARE directive
65 !$acc declare present(cc)
70 !ERROR: The ZERO modifier is not allowed for the COPYOUT clause on the DECLARE directive
71 !$acc declare copyout(zero: aa)
74 end module openacc_declare_validity