1 ! RUN: %S/../test_errors.sh %s %t %flang -fopenacc
4 ! Check OpenACC clause validity for the following construct and directive:
7 program openacc_clause_validity
12 integer, parameter :: N
= 256
13 real(8), dimension(N
) :: a
16 !ERROR: Directive SET may not be called within a compute region
17 !$acc set default_async(i)
21 !ERROR: Directive SET may not be called within a compute region
22 !$acc set default_async(i)
26 !ERROR: Directive SET may not be called within a compute region
27 !$acc set default_async(i)
33 !ERROR: Directive SET may not be called within a compute region
34 !$acc set default_async(i)
42 !ERROR: Directive SET may not be called within a compute region
43 !$acc set default_async(i)
51 !ERROR: Directive SET may not be called within a compute region
52 !$acc set default_async(i)
59 !ERROR: Directive SET may not be called within a compute region
60 !$acc set default_async(i)
66 !ERROR: Directive SET may not be called within a compute region
67 !$acc set default_async(i)
73 !ERROR: Directive SET may not be called within a compute region
74 !$acc set default_async(i)
78 !ERROR: At least one of DEFAULT_ASYNC, DEVICE_NUM, DEVICE_TYPE clause must appear on the SET directive
81 !ERROR: At least one of DEFAULT_ASYNC, DEVICE_NUM, DEVICE_TYPE clause must appear on the SET directive
84 !ERROR: At most one DEFAULT_ASYNC clause can appear on the SET directive
85 !$acc set default_async(2) default_async(1)
87 !ERROR: At most one DEFAULT_ASYNC clause can appear on the SET directive
88 !$acc set default_async(2) default_async(1)
90 !ERROR: At most one DEVICE_NUM clause can appear on the SET directive
91 !$acc set device_num(1) device_num(i)
93 !ERROR: At most one DEVICE_TYPE clause can appear on the SET directive
94 !$acc set device_type(i) device_type(2, i, j)
96 !$acc set default_async(2)
97 !$acc set default_async(i)
98 !$acc set device_num(1)
99 !$acc set device_num(i)
100 !$acc set device_type(i)
101 !$acc set device_type(2, i, j)
102 !$acc set device_num(1) default_async(2) device_type(2, i, j)
104 !ERROR: At least one of DEFAULT_ASYNC, DEVICE_NUM, DEVICE_TYPE clause must appear on the SET directive
107 end program openacc_clause_validity