1 ! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
4 ! Check OpenACC clause validity for the following construct and directive:
7 program openacc_init_validity
12 integer, parameter :: N
= 256
13 logical :: ifCondition
= .TRUE
.
14 real(8), dimension(N
) :: a
18 !$acc init if(ifCondition)
19 !$acc init device_num(1)
20 !$acc init device_num(i)
21 !$acc init device_type(i)
22 !$acc init device_type(2, i, j)
23 !$acc init device_num(i) device_type(i, j) if(ifCondition)
26 !ERROR: Directive INIT may not be called within a compute region
31 !ERROR: Directive INIT may not be called within a compute region
36 !ERROR: Directive INIT may not be called within a compute region
43 !ERROR: Directive INIT may not be called within a compute region
52 !ERROR: Directive INIT may not be called within a compute region
61 !ERROR: Directive INIT may not be called within a compute region
69 !ERROR: Directive INIT may not be called within a compute region
76 !ERROR: Directive INIT may not be called within a compute region
83 !ERROR: Directive INIT may not be called within a compute region
88 !ERROR: At most one IF clause can appear on the INIT directive
89 !$acc init if(.TRUE.) if(ifCondition)
91 !ERROR: At most one DEVICE_NUM clause can appear on the INIT directive
92 !$acc init device_num(1) device_num(i)
94 !ERROR: At most one DEVICE_TYPE clause can appear on the INIT directive
95 !$acc init device_type(2) device_type(i, j)
97 end program openacc_init_validity