1 ! RUN: %S/test_errors.sh %s %t %flang -fopenmp
8 real(8) :: a(256), b(256)
11 !ERROR: `DISTRIBUTE` region has to be strictly nested inside `TEAMS` region.
16 !$omp end distribute simd
18 !$omp target parallel device(0)
22 !$omp end target parallel
24 !ERROR: At most one DEVICE clause can appear on the TARGET PARALLEL directive
25 !$omp target parallel device(0) device(1)
29 !$omp end target parallel
31 !$omp target parallel defaultmap(tofrom:scalar)
35 !$omp end target parallel
37 !ERROR: The argument TOFROM:SCALAR must be specified on the DEFAULTMAP clause
38 !$omp target parallel defaultmap(tofrom)
42 !$omp end target parallel
44 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET PARALLEL directive
45 !$omp target parallel defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)
49 !$omp end target parallel
51 !$omp target parallel map(tofrom:a)
55 !$omp end target parallel
57 !ERROR: COPYIN clause is not allowed on the TARGET PARALLEL directive
58 !ERROR: Non-THREADPRIVATE object 'a' in COPYIN clause
59 !$omp target parallel copyin(a)
63 !$omp end target parallel
65 !$omp target parallel do device(0)
69 !$omp end target parallel do
71 !ERROR: At most one DEVICE clause can appear on the TARGET PARALLEL DO directive
72 !$omp target parallel do device(0) device(1)
76 !$omp end target parallel do
78 !$omp target parallel do defaultmap(tofrom:scalar)
82 !$omp end target parallel do
84 !ERROR: The argument TOFROM:SCALAR must be specified on the DEFAULTMAP clause
85 !$omp target parallel do defaultmap(tofrom)
89 !$omp end target parallel do
91 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET PARALLEL DO directive
92 !$omp target parallel do defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)
96 !$omp end target parallel do
98 !$omp target parallel do map(tofrom:a)
102 !$omp end target parallel do
104 !ERROR: Non-THREADPRIVATE object 'a' in COPYIN clause
105 !$omp target parallel do copyin(a)
109 !$omp end target parallel do
111 !$omp target teams map(a)
115 !$omp end target teams
117 !$omp target teams device(0)
121 !$omp end target teams
123 !ERROR: At most one DEVICE clause can appear on the TARGET TEAMS directive
124 !$omp target teams device(0) device(1)
128 !$omp end target teams
130 !ERROR: SCHEDULE clause is not allowed on the TARGET TEAMS directive
131 !$omp target teams schedule(static)
135 !$omp end target teams
137 !$omp target teams defaultmap(tofrom:scalar)
141 !$omp end target teams
143 !ERROR: The argument TOFROM:SCALAR must be specified on the DEFAULTMAP clause
144 !$omp target teams defaultmap(tofrom)
148 !$omp end target teams
150 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET TEAMS directive
151 !$omp target teams defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)
155 !$omp end target teams
157 !$omp target teams num_teams(3) thread_limit(10) default(shared) private(i) shared(a)
161 !$omp end target teams
163 !ERROR: At most one NUM_TEAMS clause can appear on the TARGET TEAMS directive
164 !$omp target teams num_teams(2) num_teams(3)
168 !$omp end target teams
170 !ERROR: The parameter of the NUM_TEAMS clause must be a positive integer expression
171 !$omp target teams num_teams(-1)
175 !$omp end target teams
177 !ERROR: At most one THREAD_LIMIT clause can appear on the TARGET TEAMS directive
178 !$omp target teams thread_limit(2) thread_limit(3)
182 !$omp end target teams
184 !ERROR: The parameter of the THREAD_LIMIT clause must be a positive integer expression
185 !$omp target teams thread_limit(-1)
189 !$omp end target teams
191 !ERROR: At most one DEFAULT clause can appear on the TARGET TEAMS directive
192 !$omp target teams default(shared) default(private)
196 !$omp end target teams
198 !$omp target teams num_teams(2) defaultmap(tofrom:scalar)
202 !$omp end target teams
204 !$omp target teams map(tofrom:a)
208 !$omp end target teams
210 !ERROR: Only the TO, FROM, TOFROM, ALLOC map types are permitted for MAP clauses on the TARGET TEAMS directive
211 !$omp target teams map(delete:a)
215 !$omp end target teams
218 !$omp target teams distribute map(a)
222 !$omp end target teams distribute
224 !$omp target teams distribute device(0)
228 !$omp end target teams distribute
230 !ERROR: At most one DEVICE clause can appear on the TARGET TEAMS DISTRIBUTE directive
231 !$omp target teams distribute device(0) device(1)
235 !$omp end target teams distribute
237 !$omp target teams distribute defaultmap(tofrom:scalar)
241 !$omp end target teams distribute
243 !ERROR: The argument TOFROM:SCALAR must be specified on the DEFAULTMAP clause
244 !$omp target teams distribute defaultmap(tofrom)
248 !$omp end target teams distribute
250 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET TEAMS DISTRIBUTE directive
251 !$omp target teams distribute defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)
255 !$omp end target teams distribute
257 !$omp target teams distribute num_teams(3) thread_limit(10) default(shared) private(i) shared(a)
261 !$omp end target teams distribute
263 !ERROR: At most one NUM_TEAMS clause can appear on the TARGET TEAMS DISTRIBUTE directive
264 !$omp target teams distribute num_teams(2) num_teams(3)
268 !$omp end target teams distribute
270 !ERROR: The parameter of the NUM_TEAMS clause must be a positive integer expression
271 !$omp target teams distribute num_teams(-1)
275 !$omp end target teams distribute
277 !ERROR: At most one THREAD_LIMIT clause can appear on the TARGET TEAMS DISTRIBUTE directive
278 !$omp target teams distribute thread_limit(2) thread_limit(3)
282 !$omp end target teams distribute
284 !ERROR: The parameter of the THREAD_LIMIT clause must be a positive integer expression
285 !$omp target teams distribute thread_limit(-1)
289 !$omp end target teams distribute
291 !ERROR: At most one DEFAULT clause can appear on the TARGET TEAMS DISTRIBUTE directive
292 !$omp target teams distribute default(shared) default(private)
296 !$omp end target teams distribute
298 !$omp target teams distribute num_teams(2) defaultmap(tofrom:scalar)
302 !$omp end target teams distribute
304 !$omp target teams distribute map(tofrom:a)
308 !$omp end target teams distribute
310 !ERROR: Only the TO, FROM, TOFROM, ALLOC map types are permitted for MAP clauses on the TARGET TEAMS DISTRIBUTE directive
311 !$omp target teams distribute map(delete:a)
315 !$omp end target teams distribute
317 !$omp target teams distribute parallel do device(0)
321 !$omp end target teams distribute parallel do
323 !ERROR: At most one DEVICE clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive
324 !$omp target teams distribute parallel do device(0) device(1)
328 !$omp end target teams distribute parallel do
330 !$omp target teams distribute parallel do defaultmap(tofrom:scalar)
334 !$omp end target teams distribute parallel do
336 !ERROR: The argument TOFROM:SCALAR must be specified on the DEFAULTMAP clause
337 !$omp target teams distribute parallel do defaultmap(tofrom)
341 !$omp end target teams distribute parallel do
343 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive
344 !$omp target teams distribute parallel do defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)
348 !$omp end target teams distribute parallel do
350 !$omp target teams distribute parallel do num_teams(3) thread_limit(10) default(shared) private(i) shared(a)
354 !$omp end target teams distribute parallel do
356 !ERROR: At most one NUM_TEAMS clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive
357 !$omp target teams distribute parallel do num_teams(2) num_teams(3)
361 !$omp end target teams distribute parallel do
363 !ERROR: The parameter of the NUM_TEAMS clause must be a positive integer expression
364 !$omp target teams distribute parallel do num_teams(-1)
368 !$omp end target teams distribute parallel do
370 !ERROR: At most one THREAD_LIMIT clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive
371 !$omp target teams distribute parallel do thread_limit(2) thread_limit(3)
375 !$omp end target teams distribute parallel do
377 !ERROR: The parameter of the THREAD_LIMIT clause must be a positive integer expression
378 !$omp target teams distribute parallel do thread_limit(-1)
382 !$omp end target teams distribute parallel do
384 !ERROR: At most one DEFAULT clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive
385 !$omp target teams distribute parallel do default(shared) default(private)
389 !$omp end target teams distribute parallel do
391 !$omp target teams distribute parallel do num_teams(2) defaultmap(tofrom:scalar)
395 !$omp end target teams distribute parallel do
397 !$omp target teams distribute parallel do map(tofrom:a)
401 !$omp end target teams distribute parallel do
403 !ERROR: Only the TO, FROM, TOFROM, ALLOC map types are permitted for MAP clauses on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive
404 !$omp target teams distribute parallel do map(delete:a)
408 !$omp end target teams distribute parallel do
411 !$omp target teams distribute parallel do simd map(a)
415 !$omp end target teams distribute parallel do simd
417 !$omp target teams distribute parallel do simd device(0)
421 !$omp end target teams distribute parallel do simd
423 !ERROR: At most one DEVICE clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive
424 !$omp target teams distribute parallel do simd device(0) device(1)
428 !$omp end target teams distribute parallel do simd
430 !$omp target teams distribute parallel do simd defaultmap(tofrom:scalar)
434 !$omp end target teams distribute parallel do simd
436 !ERROR: The argument TOFROM:SCALAR must be specified on the DEFAULTMAP clause
437 !$omp target teams distribute parallel do simd defaultmap(tofrom)
441 !$omp end target teams distribute parallel do simd
443 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive
444 !$omp target teams distribute parallel do simd defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)
448 !$omp end target teams distribute parallel do simd
450 !$omp target teams distribute parallel do simd num_teams(3) thread_limit(10) default(shared) private(i) shared(a)
454 !$omp end target teams distribute parallel do simd
456 !ERROR: At most one NUM_TEAMS clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive
457 !$omp target teams distribute parallel do simd num_teams(2) num_teams(3)
461 !$omp end target teams distribute parallel do simd
463 !ERROR: The parameter of the NUM_TEAMS clause must be a positive integer expression
464 !$omp target teams distribute parallel do simd num_teams(-1)
468 !$omp end target teams distribute parallel do simd
470 !ERROR: At most one THREAD_LIMIT clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive
471 !$omp target teams distribute parallel do simd thread_limit(2) thread_limit(3)
475 !$omp end target teams distribute parallel do simd
477 !ERROR: The parameter of the THREAD_LIMIT clause must be a positive integer expression
478 !$omp target teams distribute parallel do simd thread_limit(-1)
482 !$omp end target teams distribute parallel do simd
484 !ERROR: At most one DEFAULT clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive
485 !$omp target teams distribute parallel do simd default(shared) default(private)
489 !$omp end target teams distribute parallel do simd
491 !$omp target teams distribute parallel do simd num_teams(2) defaultmap(tofrom:scalar)
495 !$omp end target teams distribute parallel do simd
497 !$omp target teams distribute parallel do simd map(tofrom:a)
501 !$omp end target teams distribute parallel do simd
503 !ERROR: Only the TO, FROM, TOFROM, ALLOC map types are permitted for MAP clauses on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive
504 !$omp target teams distribute parallel do simd map(delete:a)
508 !$omp end target teams distribute parallel do simd