1 ! RUN: %python %S/../test_errors.py %s %flang -fopenmp
7 real(8) :: a(256), b(256)
10 !ERROR: `DISTRIBUTE` region has to be strictly nested inside `TEAMS` region.
15 !$omp end distribute simd
17 !$omp target parallel device(0)
21 !$omp end target parallel
23 !ERROR: At most one DEVICE clause can appear on the TARGET PARALLEL directive
24 !$omp target parallel device(0) device(1)
28 !$omp end target parallel
30 !$omp target parallel defaultmap(tofrom:scalar)
34 !$omp end target parallel
36 !ERROR: The argument TOFROM:SCALAR must be specified on the DEFAULTMAP clause
37 !$omp target parallel defaultmap(tofrom)
41 !$omp end target parallel
43 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET PARALLEL directive
44 !$omp target parallel defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)
48 !$omp end target parallel
50 !$omp target parallel map(tofrom:a)
54 !$omp end target parallel
56 !ERROR: COPYIN clause is not allowed on the TARGET PARALLEL directive
57 !ERROR: Non-THREADPRIVATE object 'a' in COPYIN clause
58 !$omp target parallel copyin(a)
62 !$omp end target parallel
64 !$omp target parallel do device(0)
68 !$omp end target parallel do
70 !ERROR: At most one DEVICE clause can appear on the TARGET PARALLEL DO directive
71 !$omp target parallel do device(0) device(1)
75 !$omp end target parallel do
77 !$omp target parallel do defaultmap(tofrom:scalar)
81 !$omp end target parallel do
83 !ERROR: The argument TOFROM:SCALAR must be specified on the DEFAULTMAP clause
84 !$omp target parallel do defaultmap(tofrom)
88 !$omp end target parallel do
90 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET PARALLEL DO directive
91 !$omp target parallel do defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)
95 !$omp end target parallel do
97 !$omp target parallel do map(tofrom:a)
101 !$omp end target parallel do
103 !ERROR: Non-THREADPRIVATE object 'a' in COPYIN clause
104 !$omp target parallel do copyin(a)
108 !$omp end target parallel do
110 !$omp target teams map(a)
114 !$omp end target teams
116 !$omp target teams device(0)
120 !$omp end target teams
122 !ERROR: At most one DEVICE clause can appear on the TARGET TEAMS directive
123 !$omp target teams device(0) device(1)
127 !$omp end target teams
129 !ERROR: SCHEDULE clause is not allowed on the TARGET TEAMS directive
130 !$omp target teams schedule(static)
134 !$omp end target teams
136 !$omp target teams defaultmap(tofrom:scalar)
140 !$omp end target teams
142 !ERROR: The argument TOFROM:SCALAR must be specified on the DEFAULTMAP clause
143 !$omp target teams defaultmap(tofrom)
147 !$omp end target teams
149 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET TEAMS directive
150 !$omp target teams defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)
154 !$omp end target teams
156 !$omp target teams num_teams(3) thread_limit(10) default(shared) private(i) shared(a)
160 !$omp end target teams
162 !ERROR: At most one NUM_TEAMS clause can appear on the TARGET TEAMS directive
163 !$omp target teams num_teams(2) num_teams(3)
167 !$omp end target teams
169 !ERROR: The parameter of the NUM_TEAMS clause must be a positive integer expression
170 !$omp target teams num_teams(-1)
174 !$omp end target teams
176 !ERROR: At most one THREAD_LIMIT clause can appear on the TARGET TEAMS directive
177 !$omp target teams thread_limit(2) thread_limit(3)
181 !$omp end target teams
183 !ERROR: The parameter of the THREAD_LIMIT clause must be a positive integer expression
184 !$omp target teams thread_limit(-1)
188 !$omp end target teams
190 !ERROR: At most one DEFAULT clause can appear on the TARGET TEAMS directive
191 !$omp target teams default(shared) default(private)
195 !$omp end target teams
197 !$omp target teams num_teams(2) defaultmap(tofrom:scalar)
201 !$omp end target teams
203 !$omp target teams map(tofrom:a)
207 !$omp end target teams
209 !ERROR: Only the TO, FROM, TOFROM, ALLOC map types are permitted for MAP clauses on the TARGET TEAMS directive
210 !$omp target teams map(delete:a)
214 !$omp end target teams
217 !$omp target teams distribute map(a)
221 !$omp end target teams distribute
223 !$omp target teams distribute device(0)
227 !$omp end target teams distribute
229 !ERROR: At most one DEVICE clause can appear on the TARGET TEAMS DISTRIBUTE directive
230 !$omp target teams distribute device(0) device(1)
234 !$omp end target teams distribute
236 !$omp target teams distribute defaultmap(tofrom:scalar)
240 !$omp end target teams distribute
242 !ERROR: The argument TOFROM:SCALAR must be specified on the DEFAULTMAP clause
243 !$omp target teams distribute defaultmap(tofrom)
247 !$omp end target teams distribute
249 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET TEAMS DISTRIBUTE directive
250 !$omp target teams distribute defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)
254 !$omp end target teams distribute
256 !$omp target teams distribute num_teams(3) thread_limit(10) default(shared) private(i) shared(a)
260 !$omp end target teams distribute
262 !ERROR: At most one NUM_TEAMS clause can appear on the TARGET TEAMS DISTRIBUTE directive
263 !$omp target teams distribute num_teams(2) num_teams(3)
267 !$omp end target teams distribute
269 !ERROR: The parameter of the NUM_TEAMS clause must be a positive integer expression
270 !$omp target teams distribute num_teams(-1)
274 !$omp end target teams distribute
276 !ERROR: At most one THREAD_LIMIT clause can appear on the TARGET TEAMS DISTRIBUTE directive
277 !$omp target teams distribute thread_limit(2) thread_limit(3)
281 !$omp end target teams distribute
283 !ERROR: The parameter of the THREAD_LIMIT clause must be a positive integer expression
284 !$omp target teams distribute thread_limit(-1)
288 !$omp end target teams distribute
290 !ERROR: At most one DEFAULT clause can appear on the TARGET TEAMS DISTRIBUTE directive
291 !$omp target teams distribute default(shared) default(private)
295 !$omp end target teams distribute
297 !$omp target teams distribute num_teams(2) defaultmap(tofrom:scalar)
301 !$omp end target teams distribute
303 !$omp target teams distribute map(tofrom:a)
307 !$omp end target teams distribute
309 !ERROR: Only the TO, FROM, TOFROM, ALLOC map types are permitted for MAP clauses on the TARGET TEAMS DISTRIBUTE directive
310 !$omp target teams distribute map(delete:a)
314 !$omp end target teams distribute
316 !$omp target teams distribute parallel do device(0)
320 !$omp end target teams distribute parallel do
322 !ERROR: At most one DEVICE clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive
323 !$omp target teams distribute parallel do device(0) device(1)
327 !$omp end target teams distribute parallel do
329 !$omp target teams distribute parallel do defaultmap(tofrom:scalar)
333 !$omp end target teams distribute parallel do
335 !ERROR: The argument TOFROM:SCALAR must be specified on the DEFAULTMAP clause
336 !$omp target teams distribute parallel do defaultmap(tofrom)
340 !$omp end target teams distribute parallel do
342 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive
343 !$omp target teams distribute parallel do defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)
347 !$omp end target teams distribute parallel do
349 !$omp target teams distribute parallel do num_teams(3) thread_limit(10) default(shared) private(i) shared(a)
353 !$omp end target teams distribute parallel do
355 !ERROR: At most one NUM_TEAMS clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive
356 !$omp target teams distribute parallel do num_teams(2) num_teams(3)
360 !$omp end target teams distribute parallel do
362 !ERROR: The parameter of the NUM_TEAMS clause must be a positive integer expression
363 !$omp target teams distribute parallel do num_teams(-1)
367 !$omp end target teams distribute parallel do
369 !ERROR: At most one THREAD_LIMIT clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive
370 !$omp target teams distribute parallel do thread_limit(2) thread_limit(3)
374 !$omp end target teams distribute parallel do
376 !ERROR: The parameter of the THREAD_LIMIT clause must be a positive integer expression
377 !$omp target teams distribute parallel do thread_limit(-1)
381 !$omp end target teams distribute parallel do
383 !ERROR: At most one DEFAULT clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive
384 !$omp target teams distribute parallel do default(shared) default(private)
388 !$omp end target teams distribute parallel do
390 !$omp target teams distribute parallel do num_teams(2) defaultmap(tofrom:scalar)
394 !$omp end target teams distribute parallel do
396 !$omp target teams distribute parallel do map(tofrom:a)
400 !$omp end target teams distribute parallel do
402 !ERROR: Only the TO, FROM, TOFROM, ALLOC map types are permitted for MAP clauses on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive
403 !$omp target teams distribute parallel do map(delete:a)
407 !$omp end target teams distribute parallel do
410 !$omp target teams distribute parallel do simd map(a)
414 !$omp end target teams distribute parallel do simd
416 !$omp target teams distribute parallel do simd device(0)
420 !$omp end target teams distribute parallel do simd
422 !ERROR: At most one DEVICE clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive
423 !$omp target teams distribute parallel do simd device(0) device(1)
427 !$omp end target teams distribute parallel do simd
429 !$omp target teams distribute parallel do simd defaultmap(tofrom:scalar)
433 !$omp end target teams distribute parallel do simd
435 !ERROR: The argument TOFROM:SCALAR must be specified on the DEFAULTMAP clause
436 !$omp target teams distribute parallel do simd defaultmap(tofrom)
440 !$omp end target teams distribute parallel do simd
442 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive
443 !$omp target teams distribute parallel do simd defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)
447 !$omp end target teams distribute parallel do simd
449 !$omp target teams distribute parallel do simd num_teams(3) thread_limit(10) default(shared) private(i) shared(a)
453 !$omp end target teams distribute parallel do simd
455 !ERROR: At most one NUM_TEAMS clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive
456 !$omp target teams distribute parallel do simd num_teams(2) num_teams(3)
460 !$omp end target teams distribute parallel do simd
462 !ERROR: The parameter of the NUM_TEAMS clause must be a positive integer expression
463 !$omp target teams distribute parallel do simd num_teams(-1)
467 !$omp end target teams distribute parallel do simd
469 !ERROR: At most one THREAD_LIMIT clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive
470 !$omp target teams distribute parallel do simd thread_limit(2) thread_limit(3)
474 !$omp end target teams distribute parallel do simd
476 !ERROR: The parameter of the THREAD_LIMIT clause must be a positive integer expression
477 !$omp target teams distribute parallel do simd thread_limit(-1)
481 !$omp end target teams distribute parallel do simd
483 !ERROR: At most one DEFAULT clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive
484 !$omp target teams distribute parallel do simd default(shared) default(private)
488 !$omp end target teams distribute parallel do simd
490 !$omp target teams distribute parallel do simd num_teams(2) defaultmap(tofrom:scalar)
494 !$omp end target teams distribute parallel do simd
496 !$omp target teams distribute parallel do simd map(tofrom:a)
500 !$omp end target teams distribute parallel do simd
502 !ERROR: Only the TO, FROM, TOFROM, ALLOC map types are permitted for MAP clauses on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive
503 !$omp target teams distribute parallel do simd map(delete:a)
507 !$omp end target teams distribute parallel do simd