blob: c7ff9f02afbf353f06414691b05a991cbbfcd5d3 [file] [log] [blame]
David Truby75c31052020-04-09 17:54:281! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
2! OPTIONS: -fopenmp
3
4program main
5 implicit none
6 integer :: N
7 integer :: i
8 real(8) :: a(256), b(256)
9 N = 256
10
11 !$omp distribute simd
12 do i = 1, N
13 a(i) = 3.14
14 enddo
15 !$omp end distribute simd
16
17 !$omp target parallel device(0)
18 do i = 1, N
19 a(i) = 3.14
20 enddo
21 !$omp end target parallel
22
23 !ERROR: At most one DEVICE clause can appear on the TARGET PARALLEL directive
24 !$omp target parallel device(0) device(1)
25 do i = 1, N
26 a(i) = 3.14
27 enddo
28 !$omp end target parallel
29
30 !$omp target parallel defaultmap(tofrom:scalar)
31 do i = 1, N
32 a(i) = 3.14
33 enddo
34 !$omp end target parallel
35
36 !ERROR: The argument TOFROM:SCALAR must be specified on the DEFAULTMAP clause
37 !$omp target parallel defaultmap(tofrom)
38 do i = 1, N
39 a(i) = 3.14
40 enddo
41 !$omp end target parallel
42
43 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET PARALLEL directive
44 !$omp target parallel defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)
45 do i = 1, N
46 a(i) = 3.14
47 enddo
48 !$omp end target parallel
49
50 !$omp target parallel map(tofrom:a)
51 do i = 1, N
52 a(i) = 3.14
53 enddo
54 !$omp end target parallel
55
56 !ERROR: COPYIN clause is not allowed on the TARGET PARALLEL directive
57 !$omp target parallel copyin(a)
58 do i = 1, N
59 a(i) = 3.14
60 enddo
61 !$omp end target parallel
62
63 !$omp target parallel do device(0)
64 do i = 1, N
65 a(i) = 3.14
66 enddo
67 !$omp end target parallel do
68
69 !ERROR: At most one DEVICE clause can appear on the TARGET PARALLEL DO directive
70 !$omp target parallel do device(0) device(1)
71 do i = 1, N
72 a(i) = 3.14
73 enddo
74 !$omp end target parallel do
75
76 !$omp target parallel do defaultmap(tofrom:scalar)
77 do i = 1, N
78 a(i) = 3.14
79 enddo
80 !$omp end target parallel do
81
82 !ERROR: The argument TOFROM:SCALAR must be specified on the DEFAULTMAP clause
83 !$omp target parallel do defaultmap(tofrom)
84 do i = 1, N
85 a(i) = 3.14
86 enddo
87 !$omp end target parallel do
88
89 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET PARALLEL DO directive
90 !$omp target parallel do defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)
91 do i = 1, N
92 a(i) = 3.14
93 enddo
94 !$omp end target parallel do
95
96 !$omp target parallel do map(tofrom:a)
97 do i = 1, N
98 a(i) = 3.14
99 enddo
100 !$omp end target parallel do
101
102 !$omp target parallel do copyin(a)
103 do i = 1, N
104 a(i) = 3.14
105 enddo
106 !$omp end target parallel do
107
108 !$omp target teams map(a)
109 do i = 1, N
110 a(i) = 3.14
111 enddo
112 !$omp end target teams
113
114 !$omp target teams device(0)
115 do i = 1, N
116 a(i) = 3.14
117 enddo
118 !$omp end target teams
119
120 !ERROR: At most one DEVICE clause can appear on the TARGET TEAMS directive
121 !$omp target teams device(0) device(1)
122 do i = 1, N
123 a(i) = 3.14
124 enddo
125 !$omp end target teams
126
127 !ERROR: SCHEDULE clause is not allowed on the TARGET TEAMS directive
128 !$omp target teams schedule(static)
129 do i = 1, N
130 a(i) = 3.14
131 enddo
132 !$omp end target teams
133
134 !$omp target teams defaultmap(tofrom:scalar)
135 do i = 1, N
136 a(i) = 3.14
137 enddo
138 !$omp end target teams
139
140 !ERROR: The argument TOFROM:SCALAR must be specified on the DEFAULTMAP clause
141 !$omp target teams defaultmap(tofrom)
142 do i = 1, N
143 a(i) = 3.14
144 enddo
145 !$omp end target teams
146
147 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET TEAMS directive
148 !$omp target teams defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)
149 do i = 1, N
150 a(i) = 3.14
151 enddo
152 !$omp end target teams
153
154 !$omp target teams num_teams(3) thread_limit(10) default(shared) private(i) shared(a)
155 do i = 1, N
156 a(i) = 3.14
157 enddo
158 !$omp end target teams
159
160 !ERROR: At most one NUM_TEAMS clause can appear on the TARGET TEAMS directive
161 !$omp target teams num_teams(2) num_teams(3)
162 do i = 1, N
163 a(i) = 3.14
164 enddo
165 !$omp end target teams
166
167 !ERROR: The parameter of the NUM_TEAMS clause must be a positive integer expression
168 !$omp target teams num_teams(-1)
169 do i = 1, N
170 a(i) = 3.14
171 enddo
172 !$omp end target teams
173
174 !ERROR: At most one THREAD_LIMIT clause can appear on the TARGET TEAMS directive
175 !$omp target teams thread_limit(2) thread_limit(3)
176 do i = 1, N
177 a(i) = 3.14
178 enddo
179 !$omp end target teams
180
181 !ERROR: The parameter of the THREAD_LIMIT clause must be a positive integer expression
182 !$omp target teams thread_limit(-1)
183 do i = 1, N
184 a(i) = 3.14
185 enddo
186 !$omp end target teams
187
188 !ERROR: At most one DEFAULT clause can appear on the TARGET TEAMS directive
189 !$omp target teams default(shared) default(private)
190 do i = 1, N
191 a(i) = 3.14
192 enddo
193 !$omp end target teams
194
195 !$omp target teams num_teams(2) defaultmap(tofrom:scalar)
196 do i = 1, N
197 a(i) = 3.14
198 enddo
199 !$omp end target teams
200
201 !$omp target teams map(tofrom:a)
202 do i = 1, N
203 a(i) = 3.14
204 enddo
205 !$omp end target teams
206
207 !ERROR: Only the TO, FROM, TOFROM, or ALLOC map types are permitted for MAP clauses on the TARGET TEAMS directive
208 !$omp target teams map(delete:a)
209 do i = 1, N
210 a(i) = 3.14
211 enddo
212 !$omp end target teams
213
214
215 !$omp target teams distribute map(a)
216 do i = 1, N
217 a(i) = 3.14
218 enddo
219 !$omp end target teams distribute
220
221 !$omp target teams distribute device(0)
222 do i = 1, N
223 a(i) = 3.14
224 enddo
225 !$omp end target teams distribute
226
227 !ERROR: At most one DEVICE clause can appear on the TARGET TEAMS DISTRIBUTE directive
228 !$omp target teams distribute device(0) device(1)
229 do i = 1, N
230 a(i) = 3.14
231 enddo
232 !$omp end target teams distribute
233
234 !$omp target teams distribute defaultmap(tofrom:scalar)
235 do i = 1, N
236 a(i) = 3.14
237 enddo
238 !$omp end target teams distribute
239
240 !ERROR: The argument TOFROM:SCALAR must be specified on the DEFAULTMAP clause
241 !$omp target teams distribute defaultmap(tofrom)
242 do i = 1, N
243 a(i) = 3.14
244 enddo
245 !$omp end target teams distribute
246
247 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET TEAMS DISTRIBUTE directive
248 !$omp target teams distribute defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)
249 do i = 1, N
250 a(i) = 3.14
251 enddo
252 !$omp end target teams distribute
253
254 !$omp target teams distribute num_teams(3) thread_limit(10) default(shared) private(i) shared(a)
255 do i = 1, N
256 a(i) = 3.14
257 enddo
258 !$omp end target teams distribute
259
260 !ERROR: At most one NUM_TEAMS clause can appear on the TARGET TEAMS DISTRIBUTE directive
261 !$omp target teams distribute num_teams(2) num_teams(3)
262 do i = 1, N
263 a(i) = 3.14
264 enddo
265 !$omp end target teams distribute
266
267 !ERROR: The parameter of the NUM_TEAMS clause must be a positive integer expression
268 !$omp target teams distribute num_teams(-1)
269 do i = 1, N
270 a(i) = 3.14
271 enddo
272 !$omp end target teams distribute
273
274 !ERROR: At most one THREAD_LIMIT clause can appear on the TARGET TEAMS DISTRIBUTE directive
275 !$omp target teams distribute thread_limit(2) thread_limit(3)
276 do i = 1, N
277 a(i) = 3.14
278 enddo
279 !$omp end target teams distribute
280
281 !ERROR: The parameter of the THREAD_LIMIT clause must be a positive integer expression
282 !$omp target teams distribute thread_limit(-1)
283 do i = 1, N
284 a(i) = 3.14
285 enddo
286 !$omp end target teams distribute
287
288 !ERROR: At most one DEFAULT clause can appear on the TARGET TEAMS DISTRIBUTE directive
289 !$omp target teams distribute default(shared) default(private)
290 do i = 1, N
291 a(i) = 3.14
292 enddo
293 !$omp end target teams distribute
294
295 !$omp target teams distribute num_teams(2) defaultmap(tofrom:scalar)
296 do i = 1, N
297 a(i) = 3.14
298 enddo
299 !$omp end target teams distribute
300
301 !$omp target teams distribute map(tofrom:a)
302 do i = 1, N
303 a(i) = 3.14
304 enddo
305 !$omp end target teams distribute
306
307 !ERROR: Only the TO, FROM, TOFROM, or ALLOC map types are permitted for MAP clauses on the TARGET TEAMS DISTRIBUTE directive
308 !$omp target teams distribute map(delete:a)
309 do i = 1, N
310 a(i) = 3.14
311 enddo
312 !$omp end target teams distribute
313
314 !$omp target teams distribute parallel do device(0)
315 do i = 1, N
316 a(i) = 3.14
317 enddo
318 !$omp end target teams distribute parallel do
319
320 !ERROR: At most one DEVICE clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive
321 !$omp target teams distribute parallel do device(0) device(1)
322 do i = 1, N
323 a(i) = 3.14
324 enddo
325 !$omp end target teams distribute parallel do
326
327 !$omp target teams distribute parallel do defaultmap(tofrom:scalar)
328 do i = 1, N
329 a(i) = 3.14
330 enddo
331 !$omp end target teams distribute parallel do
332
333 !ERROR: The argument TOFROM:SCALAR must be specified on the DEFAULTMAP clause
334 !$omp target teams distribute parallel do defaultmap(tofrom)
335 do i = 1, N
336 a(i) = 3.14
337 enddo
338 !$omp end target teams distribute parallel do
339
340 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive
341 !$omp target teams distribute parallel do defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)
342 do i = 1, N
343 a(i) = 3.14
344 enddo
345 !$omp end target teams distribute parallel do
346
347 !$omp target teams distribute parallel do num_teams(3) thread_limit(10) default(shared) private(i) shared(a)
348 do i = 1, N
349 a(i) = 3.14
350 enddo
351 !$omp end target teams distribute parallel do
352
353 !ERROR: At most one NUM_TEAMS clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive
354 !$omp target teams distribute parallel do num_teams(2) num_teams(3)
355 do i = 1, N
356 a(i) = 3.14
357 enddo
358 !$omp end target teams distribute parallel do
359
360 !ERROR: The parameter of the NUM_TEAMS clause must be a positive integer expression
361 !$omp target teams distribute parallel do num_teams(-1)
362 do i = 1, N
363 a(i) = 3.14
364 enddo
365 !$omp end target teams distribute parallel do
366
367 !ERROR: At most one THREAD_LIMIT clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive
368 !$omp target teams distribute parallel do thread_limit(2) thread_limit(3)
369 do i = 1, N
370 a(i) = 3.14
371 enddo
372 !$omp end target teams distribute parallel do
373
374 !ERROR: The parameter of the THREAD_LIMIT clause must be a positive integer expression
375 !$omp target teams distribute parallel do thread_limit(-1)
376 do i = 1, N
377 a(i) = 3.14
378 enddo
379 !$omp end target teams distribute parallel do
380
381 !ERROR: At most one DEFAULT clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive
382 !$omp target teams distribute parallel do default(shared) default(private)
383 do i = 1, N
384 a(i) = 3.14
385 enddo
386 !$omp end target teams distribute parallel do
387
388 !$omp target teams distribute parallel do num_teams(2) defaultmap(tofrom:scalar)
389 do i = 1, N
390 a(i) = 3.14
391 enddo
392 !$omp end target teams distribute parallel do
393
394 !$omp target teams distribute parallel do map(tofrom:a)
395 do i = 1, N
396 a(i) = 3.14
397 enddo
398 !$omp end target teams distribute parallel do
399
400 !ERROR: Only the TO, FROM, TOFROM, or ALLOC map types are permitted for MAP clauses on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive
401 !$omp target teams distribute parallel do map(delete:a)
402 do i = 1, N
403 a(i) = 3.14
404 enddo
405 !$omp end target teams distribute parallel do
406
407
408 !$omp target teams distribute parallel do simd map(a)
409 do i = 1, N
410 a(i) = 3.14
411 enddo
412 !$omp end target teams distribute parallel do simd
413
414 !$omp target teams distribute parallel do simd device(0)
415 do i = 1, N
416 a(i) = 3.14
417 enddo
418 !$omp end target teams distribute parallel do simd
419
420 !ERROR: At most one DEVICE clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive
421 !$omp target teams distribute parallel do simd device(0) device(1)
422 do i = 1, N
423 a(i) = 3.14
424 enddo
425 !$omp end target teams distribute parallel do simd
426
427 !$omp target teams distribute parallel do simd defaultmap(tofrom:scalar)
428 do i = 1, N
429 a(i) = 3.14
430 enddo
431 !$omp end target teams distribute parallel do simd
432
433 !ERROR: The argument TOFROM:SCALAR must be specified on the DEFAULTMAP clause
434 !$omp target teams distribute parallel do simd defaultmap(tofrom)
435 do i = 1, N
436 a(i) = 3.14
437 enddo
438 !$omp end target teams distribute parallel do simd
439
440 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive
441 !$omp target teams distribute parallel do simd defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)
442 do i = 1, N
443 a(i) = 3.14
444 enddo
445 !$omp end target teams distribute parallel do simd
446
447 !$omp target teams distribute parallel do simd num_teams(3) thread_limit(10) default(shared) private(i) shared(a)
448 do i = 1, N
449 a(i) = 3.14
450 enddo
451 !$omp end target teams distribute parallel do simd
452
453 !ERROR: At most one NUM_TEAMS clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive
454 !$omp target teams distribute parallel do simd num_teams(2) num_teams(3)
455 do i = 1, N
456 a(i) = 3.14
457 enddo
458 !$omp end target teams distribute parallel do simd
459
460 !ERROR: The parameter of the NUM_TEAMS clause must be a positive integer expression
461 !$omp target teams distribute parallel do simd num_teams(-1)
462 do i = 1, N
463 a(i) = 3.14
464 enddo
465 !$omp end target teams distribute parallel do simd
466
467 !ERROR: At most one THREAD_LIMIT clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive
468 !$omp target teams distribute parallel do simd thread_limit(2) thread_limit(3)
469 do i = 1, N
470 a(i) = 3.14
471 enddo
472 !$omp end target teams distribute parallel do simd
473
474 !ERROR: The parameter of the THREAD_LIMIT clause must be a positive integer expression
475 !$omp target teams distribute parallel do simd thread_limit(-1)
476 do i = 1, N
477 a(i) = 3.14
478 enddo
479 !$omp end target teams distribute parallel do simd
480
481 !ERROR: At most one DEFAULT clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive
482 !$omp target teams distribute parallel do simd default(shared) default(private)
483 do i = 1, N
484 a(i) = 3.14
485 enddo
486 !$omp end target teams distribute parallel do simd
487
488 !$omp target teams distribute parallel do simd num_teams(2) defaultmap(tofrom:scalar)
489 do i = 1, N
490 a(i) = 3.14
491 enddo
492 !$omp end target teams distribute parallel do simd
493
494 !$omp target teams distribute parallel do simd map(tofrom:a)
495 do i = 1, N
496 a(i) = 3.14
497 enddo
498 !$omp end target teams distribute parallel do simd
499
500 !ERROR: Only the TO, FROM, TOFROM, or ALLOC map types are permitted for MAP clauses on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive
501 !$omp target teams distribute parallel do simd map(delete:a)
502 do i = 1, N
503 a(i) = 3.14
504 enddo
505 !$omp end target teams distribute parallel do simd
506
507
508end program main
509