[AArch64] Fix brackets warning in assert. NFC
[llvm-project.git] / flang / test / Semantics / OpenACC / acc-declare-validity.f90
blob2e7e651815d4a3a4c0659fc0e43f380989700072
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, ac, ad, ae, af, cc, dd
12 !ERROR: At least one clause is required on the DECLARE directive
13 !$acc declare
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)
42 contains
44 subroutine sub1(cc, dd)
45 real(8) :: cc(:)
46 real(8) :: 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)
50 end subroutine sub1
52 function fct1(ee, ff, gg, hh, ii)
53 integer :: fct1
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)
60 end function fct1
62 subroutine sub2(cc)
63 real(8), dimension(*) :: cc
64 !ERROR: Assumed-size dummy arrays may not appear on the DECLARE directive
65 !$acc declare present(cc)
66 end subroutine sub2
68 subroutine sub3()
69 real :: aa(100)
70 !ERROR: The ZERO modifier is not allowed for the COPYOUT clause on the DECLARE directive
71 !$acc declare copyout(zero: aa)
72 end subroutine
74 end module openacc_declare_validity