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
.
15 real(8), dimension(N
) :: a
19 !$acc init if(ifCondition)
21 !$acc init device_num(1)
22 !$acc init device_num(i)
23 !$acc init device_type(default)
24 !$acc init device_type(nvidia, radeon)
25 !$acc init device_num(i) device_type(host, multicore) if(ifCondition)
28 !ERROR: Directive INIT may not be called within a compute region
33 !ERROR: Directive INIT may not be called within a compute region
38 !ERROR: Directive INIT may not be called within a compute region
45 !ERROR: Directive INIT may not be called within a compute region
54 !ERROR: Directive INIT may not be called within a compute region
63 !ERROR: Directive INIT may not be called within a compute region
71 !ERROR: Directive INIT may not be called within a compute region
78 !ERROR: Directive INIT may not be called within a compute region
85 !ERROR: Directive INIT may not be called within a compute region
90 !ERROR: At most one IF clause can appear on the INIT directive
91 !$acc init if(.TRUE.) if(ifCondition)
93 !ERROR: At most one DEVICE_NUM clause can appear on the INIT directive
94 !$acc init device_num(1) device_num(i)
96 !ERROR: At most one DEVICE_TYPE clause can appear on the INIT directive
97 !$acc init device_type(nvidia) device_type(default, *)
99 !ERROR: Must have LOGICAL or INTEGER type
100 !$acc init if(ifReal)
102 end program openacc_init_validity