1 ! RUN: %python %S/../test_errors.py %s %flang -fopenmp
4 ! Check OpenMP construct validity for the following directives:
5 ! 2.18.2 Cancellation Point Construct
11 !ERROR: CANCELLATION POINT TASKGROUP directive is not closely nested inside TASK or TASKLOOP
12 !$omp cancellation point taskgroup
14 !ERROR: CANCELLATION POINT SECTIONS directive is not closely nested inside SECTION or SECTIONS
15 !$omp cancellation point sections
17 !ERROR: CANCELLATION POINT DO directive is not closely nested inside the construct that matches the DO clause type
18 !$omp cancellation point do
20 !ERROR: CANCELLATION POINT PARALLEL directive is not closely nested inside the construct that matches the PARALLEL clause type
21 !$omp cancellation point parallel
25 !$omp cancellation point sections
33 !$omp cancellation point sections
38 !ERROR: With SECTIONS clause, CANCELLATION POINT construct cannot be closely nested inside PARALLEL construct
39 !$omp cancellation point sections
43 !$omp parallel sections
44 !$omp cancellation point sections
46 !$omp end parallel sections
51 !$omp cancellation point do
58 !$omp cancellation point do
64 !$omp distribute parallel do
67 !$omp cancellation point do
69 !$omp end distribute parallel do
74 !$omp teams distribute parallel do
77 !$omp cancellation point do
79 !$omp end teams distribute parallel do
82 !$omp target teams distribute parallel do
85 !$omp cancellation point do
87 !$omp end target teams distribute parallel do
89 !$omp target parallel do
92 !$omp cancellation point do
94 !$omp end target parallel do
99 !ERROR: With DO clause, CANCELLATION POINT construct cannot be closely nested inside PARALLEL construct
100 !$omp cancellation point do
107 !$omp cancellation point parallel
111 !$omp target parallel
114 !$omp cancellation point parallel
116 !$omp end target parallel
118 !$omp target parallel do
121 !ERROR: With PARALLEL clause, CANCELLATION POINT construct cannot be closely nested inside TARGET PARALLEL DO construct
122 !$omp cancellation point parallel
124 !$omp end target parallel do
129 !ERROR: With PARALLEL clause, CANCELLATION POINT construct cannot be closely nested inside DO construct
130 !$omp cancellation point parallel
137 !$omp cancellation point taskgroup
145 !$omp cancellation point taskgroup
150 !$omp taskloop nogroup
152 !$omp cancellation point taskgroup
157 !ERROR: With TASKGROUP clause, CANCELLATION POINT construct must be closely nested inside TASK or TASKLOOP construct and CANCELLATION POINT region must be closely nested inside TASKGROUP region
158 !$omp cancellation point taskgroup
165 !$omp cancellation point taskgroup
174 !$omp cancellation point taskgroup
182 !ERROR: With TASKGROUP clause, CANCELLATION POINT construct must be closely nested inside TASK or TASKLOOP construct and CANCELLATION POINT region must be closely nested inside TASKGROUP region
183 !$omp cancellation point taskgroup
192 !ERROR: With TASKGROUP clause, CANCELLATION POINT construct must be closely nested inside TASK or TASKLOOP construct and CANCELLATION POINT region must be closely nested inside TASKGROUP region
193 !$omp cancellation point taskgroup
200 !$omp target parallel
202 !ERROR: With TASKGROUP clause, CANCELLATION POINT construct must be closely nested inside TASK or TASKLOOP construct and CANCELLATION POINT region must be closely nested inside TASKGROUP region
203 !$omp cancellation point taskgroup
206 !$omp end target parallel
209 !$omp taskloop private(j) nogroup
211 !ERROR: With TASKGROUP clause, CANCELLATION POINT construct must be closely nested inside TASK or TASKLOOP construct and CANCELLATION POINT region must be closely nested inside TASKGROUP region
212 !$omp cancellation point taskgroup
221 !$omp cancellation point taskgroup
229 !$omp taskloop nogroup
231 !$omp cancellation point taskgroup
238 !$omp target parallel
239 !$omp taskloop nogroup
241 !ERROR: With TASKGROUP clause, CANCELLATION POINT construct must be closely nested inside TASK or TASKLOOP construct and CANCELLATION POINT region must be closely nested inside TASKGROUP region
242 !$omp cancellation point taskgroup
246 !$omp end target parallel