1 ! RUN: %python %S/../test_errors.py %s %flang -fopenacc
3 ! Check OpenACC clause validity for the following construct and directive:
6 program openacc_init_validity
11 integer, parameter :: N
= 256
12 logical :: ifCondition
= .TRUE
.
13 real(8), dimension(N
) :: a
17 !$acc init if(ifCondition)
18 !$acc init device_num(1)
19 !$acc init device_num(i)
20 !$acc init device_type(i)
21 !$acc init device_type(2, i, j)
22 !$acc init device_num(i) device_type(i, j) if(ifCondition)
25 !ERROR: Directive INIT may not be called within a compute region
30 !ERROR: Directive INIT may not be called within a compute region
35 !ERROR: Directive INIT may not be called within a compute region
42 !ERROR: Directive INIT may not be called within a compute region
51 !ERROR: Directive INIT may not be called within a compute region
60 !ERROR: Directive INIT may not be called within a compute region
68 !ERROR: Directive INIT may not be called within a compute region
75 !ERROR: Directive INIT may not be called within a compute region
82 !ERROR: Directive INIT may not be called within a compute region
87 !ERROR: At most one IF clause can appear on the INIT directive
88 !$acc init if(.TRUE.) if(ifCondition)
90 !ERROR: At most one DEVICE_NUM clause can appear on the INIT directive
91 !$acc init device_num(1) device_num(i)
93 !ERROR: At most one DEVICE_TYPE clause can appear on the INIT directive
94 !$acc init device_type(2) device_type(i, j)
96 end program openacc_init_validity