1 ! RUN: %python %S/../test_errors.py %s %flang -fopenacc
3 ! Check OpenACC clause validity for the following construct and directive:
6 program openacc_clause_validity
11 integer, parameter :: N
= 256
12 real(8), dimension(N
) :: a
15 !ERROR: Directive SET may not be called within a compute region
16 !$acc set default_async(i)
20 !ERROR: Directive SET may not be called within a compute region
21 !$acc set default_async(i)
25 !ERROR: Directive SET may not be called within a compute region
26 !$acc set default_async(i)
32 !ERROR: Directive SET may not be called within a compute region
33 !$acc set default_async(i)
41 !ERROR: Directive SET may not be called within a compute region
42 !$acc set default_async(i)
50 !ERROR: Directive SET may not be called within a compute region
51 !$acc set default_async(i)
58 !ERROR: Directive SET may not be called within a compute region
59 !$acc set default_async(i)
65 !ERROR: Directive SET may not be called within a compute region
66 !$acc set default_async(i)
72 !ERROR: Directive SET may not be called within a compute region
73 !$acc set default_async(i)
77 !ERROR: At least one of DEFAULT_ASYNC, DEVICE_NUM, DEVICE_TYPE clause must appear on the SET directive
80 !ERROR: At least one of DEFAULT_ASYNC, DEVICE_NUM, DEVICE_TYPE clause must appear on the SET directive
83 !ERROR: At most one DEFAULT_ASYNC clause can appear on the SET directive
84 !$acc set default_async(2) default_async(1)
86 !ERROR: At most one DEFAULT_ASYNC clause can appear on the SET directive
87 !$acc set default_async(2) default_async(1)
89 !ERROR: At most one DEVICE_NUM clause can appear on the SET directive
90 !$acc set device_num(1) device_num(i)
92 !ERROR: At most one DEVICE_TYPE clause can appear on the SET directive
93 !$acc set device_type(*) device_type(nvidia)
95 !$acc set default_async(2)
96 !$acc set default_async(i)
97 !$acc set device_num(1)
98 !$acc set device_num(i)
99 !$acc set device_type(default)
100 !$acc set device_num(1) default_async(2) device_type(*)
102 !ERROR: The DEVICE_TYPE clause on the SET directive accepts only one value
103 !$acc set device_type(*, default)
105 !ERROR: At least one of DEFAULT_ASYNC, DEVICE_NUM, DEVICE_TYPE clause must appear on the SET directive
108 end program openacc_clause_validity