513 lines · plain
1! RUN: %python %S/../test_errors.py %s %flang -fopenmp2 3program main4 implicit none5 integer :: N6 integer :: i7 real(8) :: a(256), b(256)8 N = 2569 10 !WARNING: `DISTRIBUTE` must be dynamically enclosed in a `TEAMS` region.11 !$omp distribute simd12 do i = 1, N13 a(i) = 3.14d014 enddo15 !$omp end distribute simd16 17 !$omp target parallel device(0)18 do i = 1, N19 a(i) = 3.14d020 enddo21 !$omp end target parallel22 23 !ERROR: At most one DEVICE clause can appear on the TARGET PARALLEL directive24 !$omp target parallel device(0) device(1)25 do i = 1, N26 a(i) = 3.14d027 enddo28 !$omp end target parallel29 30 !$omp target parallel defaultmap(tofrom:scalar)31 do i = 1, N32 a(i) = 3.14d033 enddo34 !$omp end target parallel35 36 !ERROR: 'variable-category' modifier is required37 !$omp target parallel defaultmap(tofrom)38 do i = 1, N39 a(i) = 3.14d040 enddo41 !$omp end target parallel42 43 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET PARALLEL directive44 !$omp target parallel defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)45 do i = 1, N46 a(i) = 3.14d047 enddo48 !$omp end target parallel49 50 !$omp target parallel map(tofrom:a)51 do i = 1, N52 a(i) = 3.14d053 enddo54 !$omp end target parallel55 56 !ERROR: COPYIN clause is not allowed on the TARGET PARALLEL directive57 !ERROR: Non-THREADPRIVATE object 'a' in COPYIN clause58 !$omp target parallel copyin(a)59 do i = 1, N60 a(i) = 3.14d061 enddo62 !$omp end target parallel63 64 !$omp target parallel do device(0)65 do i = 1, N66 a(i) = 3.14d067 enddo68 !$omp end target parallel do69 70 !ERROR: At most one DEVICE clause can appear on the TARGET PARALLEL DO directive71 !$omp target parallel do device(0) device(1)72 do i = 1, N73 a(i) = 3.14d074 enddo75 !$omp end target parallel do76 77 !$omp target parallel do defaultmap(tofrom:scalar)78 do i = 1, N79 a(i) = 3.14d080 enddo81 !$omp end target parallel do82 83 !ERROR: 'variable-category' modifier is required84 !$omp target parallel do defaultmap(tofrom)85 do i = 1, N86 a(i) = 3.14d087 enddo88 !$omp end target parallel do89 90 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET PARALLEL DO directive91 !$omp target parallel do defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)92 do i = 1, N93 a(i) = 3.14d094 enddo95 !$omp end target parallel do96 97 !$omp target parallel do map(tofrom:a)98 do i = 1, N99 a(i) = 3.14d0100 enddo101 !$omp end target parallel do102 103 !ERROR: COPYIN clause is not allowed on the TARGET PARALLEL DO directive104 !ERROR: Non-THREADPRIVATE object 'a' in COPYIN clause105 !$omp target parallel do copyin(a)106 do i = 1, N107 a(i) = 3.14d0108 enddo109 !$omp end target parallel do110 111 !$omp target teams map(a)112 do i = 1, N113 a(i) = 3.14d0114 enddo115 !$omp end target teams116 117 !$omp target teams device(0)118 do i = 1, N119 a(i) = 3.14d0120 enddo121 !$omp end target teams122 123 !ERROR: At most one DEVICE clause can appear on the TARGET TEAMS directive124 !$omp target teams device(0) device(1)125 do i = 1, N126 a(i) = 3.14d0127 enddo128 !$omp end target teams129 130 !ERROR: SCHEDULE clause is not allowed on the TARGET TEAMS directive131 !$omp target teams schedule(static)132 do i = 1, N133 a(i) = 3.14d0134 enddo135 !$omp end target teams136 137 !$omp target teams defaultmap(tofrom:scalar)138 do i = 1, N139 a(i) = 3.14d0140 enddo141 !$omp end target teams142 143 !ERROR: 'variable-category' modifier is required144 !$omp target teams defaultmap(tofrom)145 do i = 1, N146 a(i) = 3.14d0147 enddo148 !$omp end target teams149 150 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET TEAMS directive151 !$omp target teams defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)152 do i = 1, N153 a(i) = 3.14d0154 enddo155 !$omp end target teams156 157 !$omp target teams num_teams(3) thread_limit(10) default(shared) private(i) shared(a)158 do i = 1, N159 a(i) = 3.14d0160 enddo161 !$omp end target teams162 163 !ERROR: At most one NUM_TEAMS clause can appear on the TARGET TEAMS directive164 !$omp target teams num_teams(2) num_teams(3)165 do i = 1, N166 a(i) = 3.14d0167 enddo168 !$omp end target teams169 170 !ERROR: The parameter of the NUM_TEAMS clause must be a positive integer expression171 !$omp target teams num_teams(-1)172 do i = 1, N173 a(i) = 3.14d0174 enddo175 !$omp end target teams176 177 !ERROR: At most one THREAD_LIMIT clause can appear on the TARGET TEAMS directive178 !$omp target teams thread_limit(2) thread_limit(3)179 do i = 1, N180 a(i) = 3.14d0181 enddo182 !$omp end target teams183 184 !ERROR: The parameter of the THREAD_LIMIT clause must be a positive integer expression185 !$omp target teams thread_limit(-1)186 do i = 1, N187 a(i) = 3.14d0188 enddo189 !$omp end target teams190 191 !ERROR: At most one DEFAULT clause can appear on the TARGET TEAMS directive192 !$omp target teams default(shared) default(private)193 do i = 1, N194 a(i) = 3.14d0195 enddo196 !$omp end target teams197 198 !$omp target teams num_teams(2) defaultmap(tofrom:scalar)199 do i = 1, N200 a(i) = 3.14d0201 enddo202 !$omp end target teams203 204 !$omp target teams map(tofrom:a)205 do i = 1, N206 a(i) = 3.14d0207 enddo208 !$omp end target teams209 210 !ERROR: Only the ALLOC, FROM, TO, TOFROM map types are permitted for MAP clauses on the TARGET TEAMS directive211 !$omp target teams map(delete:a)212 do i = 1, N213 a(i) = 3.14d0214 enddo215 !$omp end target teams216 217 218 !$omp target teams distribute map(a)219 do i = 1, N220 a(i) = 3.14d0221 enddo222 !$omp end target teams distribute223 224 !$omp target teams distribute device(0)225 do i = 1, N226 a(i) = 3.14d0227 enddo228 !$omp end target teams distribute229 230 !ERROR: At most one DEVICE clause can appear on the TARGET TEAMS DISTRIBUTE directive231 !$omp target teams distribute device(0) device(1)232 do i = 1, N233 a(i) = 3.14d0234 enddo235 !$omp end target teams distribute236 237 !$omp target teams distribute defaultmap(tofrom:scalar)238 do i = 1, N239 a(i) = 3.14d0240 enddo241 !$omp end target teams distribute242 243 !ERROR: 'variable-category' modifier is required244 !$omp target teams distribute defaultmap(tofrom)245 do i = 1, N246 a(i) = 3.14d0247 enddo248 !$omp end target teams distribute249 250 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET TEAMS DISTRIBUTE directive251 !$omp target teams distribute defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)252 do i = 1, N253 a(i) = 3.14d0254 enddo255 !$omp end target teams distribute256 257 !$omp target teams distribute num_teams(3) thread_limit(10) default(shared) private(i) shared(a)258 do i = 1, N259 a(i) = 3.14d0260 enddo261 !$omp end target teams distribute262 263 !ERROR: At most one NUM_TEAMS clause can appear on the TARGET TEAMS DISTRIBUTE directive264 !$omp target teams distribute num_teams(2) num_teams(3)265 do i = 1, N266 a(i) = 3.14d0267 enddo268 !$omp end target teams distribute269 270 !ERROR: The parameter of the NUM_TEAMS clause must be a positive integer expression271 !$omp target teams distribute num_teams(-1)272 do i = 1, N273 a(i) = 3.14d0274 enddo275 !$omp end target teams distribute276 277 !ERROR: At most one THREAD_LIMIT clause can appear on the TARGET TEAMS DISTRIBUTE directive278 !$omp target teams distribute thread_limit(2) thread_limit(3)279 do i = 1, N280 a(i) = 3.14d0281 enddo282 !$omp end target teams distribute283 284 !ERROR: The parameter of the THREAD_LIMIT clause must be a positive integer expression285 !$omp target teams distribute thread_limit(-1)286 do i = 1, N287 a(i) = 3.14d0288 enddo289 !$omp end target teams distribute290 291 !ERROR: At most one DEFAULT clause can appear on the TARGET TEAMS DISTRIBUTE directive292 !$omp target teams distribute default(shared) default(private)293 do i = 1, N294 a(i) = 3.14d0295 enddo296 !$omp end target teams distribute297 298 !$omp target teams distribute num_teams(2) defaultmap(tofrom:scalar)299 do i = 1, N300 a(i) = 3.14d0301 enddo302 !$omp end target teams distribute303 304 !$omp target teams distribute map(tofrom:a)305 do i = 1, N306 a(i) = 3.14d0307 enddo308 !$omp end target teams distribute309 310 !ERROR: Only the ALLOC, FROM, TO, TOFROM map types are permitted for MAP clauses on the TARGET TEAMS DISTRIBUTE directive311 !$omp target teams distribute map(delete:a)312 do i = 1, N313 a(i) = 3.14d0314 enddo315 !$omp end target teams distribute316 317 !$omp target teams distribute parallel do device(0)318 do i = 1, N319 a(i) = 3.14d0320 enddo321 !$omp end target teams distribute parallel do322 323 !ERROR: At most one DEVICE clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive324 !$omp target teams distribute parallel do device(0) device(1)325 do i = 1, N326 a(i) = 3.14d0327 enddo328 !$omp end target teams distribute parallel do329 330 !$omp target teams distribute parallel do defaultmap(tofrom:scalar)331 do i = 1, N332 a(i) = 3.14d0333 enddo334 !$omp end target teams distribute parallel do335 336 !ERROR: 'variable-category' modifier is required337 !$omp target teams distribute parallel do defaultmap(tofrom)338 do i = 1, N339 a(i) = 3.14d0340 enddo341 !$omp end target teams distribute parallel do342 343 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive344 !$omp target teams distribute parallel do defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)345 do i = 1, N346 a(i) = 3.14d0347 enddo348 !$omp end target teams distribute parallel do349 350 !$omp target teams distribute parallel do num_teams(3) thread_limit(10) default(shared) private(i) shared(a)351 do i = 1, N352 a(i) = 3.14d0353 enddo354 !$omp end target teams distribute parallel do355 356 !ERROR: At most one NUM_TEAMS clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive357 !$omp target teams distribute parallel do num_teams(2) num_teams(3)358 do i = 1, N359 a(i) = 3.14d0360 enddo361 !$omp end target teams distribute parallel do362 363 !ERROR: The parameter of the NUM_TEAMS clause must be a positive integer expression364 !$omp target teams distribute parallel do num_teams(-1)365 do i = 1, N366 a(i) = 3.14d0367 enddo368 !$omp end target teams distribute parallel do369 370 !ERROR: At most one THREAD_LIMIT clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive371 !$omp target teams distribute parallel do thread_limit(2) thread_limit(3)372 do i = 1, N373 a(i) = 3.14d0374 enddo375 !$omp end target teams distribute parallel do376 377 !ERROR: The parameter of the THREAD_LIMIT clause must be a positive integer expression378 !$omp target teams distribute parallel do thread_limit(-1)379 do i = 1, N380 a(i) = 3.14d0381 enddo382 !$omp end target teams distribute parallel do383 384 !ERROR: At most one DEFAULT clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive385 !$omp target teams distribute parallel do default(shared) default(private)386 do i = 1, N387 a(i) = 3.14d0388 enddo389 !$omp end target teams distribute parallel do390 391 !$omp target teams distribute parallel do num_teams(2) defaultmap(tofrom:scalar)392 do i = 1, N393 a(i) = 3.14d0394 enddo395 !$omp end target teams distribute parallel do396 397 !$omp target teams distribute parallel do map(tofrom:a)398 do i = 1, N399 a(i) = 3.14d0400 enddo401 !$omp end target teams distribute parallel do402 403 !ERROR: Only the ALLOC, FROM, TO, TOFROM map types are permitted for MAP clauses on the TARGET TEAMS DISTRIBUTE PARALLEL DO directive404 !$omp target teams distribute parallel do map(delete:a)405 do i = 1, N406 a(i) = 3.14d0407 enddo408 !$omp end target teams distribute parallel do409 410 411 !$omp target teams distribute parallel do simd map(a)412 do i = 1, N413 a(i) = 3.14d0414 enddo415 !$omp end target teams distribute parallel do simd416 417 !$omp target teams distribute parallel do simd device(0)418 do i = 1, N419 a(i) = 3.14d0420 enddo421 !$omp end target teams distribute parallel do simd422 423 !ERROR: At most one DEVICE clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive424 !$omp target teams distribute parallel do simd device(0) device(1)425 do i = 1, N426 a(i) = 3.14d0427 enddo428 !$omp end target teams distribute parallel do simd429 430 !$omp target teams distribute parallel do simd defaultmap(tofrom:scalar)431 do i = 1, N432 a(i) = 3.14d0433 enddo434 !$omp end target teams distribute parallel do simd435 436 !ERROR: 'variable-category' modifier is required437 !$omp target teams distribute parallel do simd defaultmap(tofrom)438 do i = 1, N439 a(i) = 3.14d0440 enddo441 !$omp end target teams distribute parallel do simd442 443 !ERROR: At most one DEFAULTMAP clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive444 !$omp target teams distribute parallel do simd defaultmap(tofrom:scalar) defaultmap(tofrom:scalar)445 do i = 1, N446 a(i) = 3.14d0447 enddo448 !$omp end target teams distribute parallel do simd449 450 !$omp target teams distribute parallel do simd num_teams(3) thread_limit(10) default(shared) private(i) shared(a)451 do i = 1, N452 a(i) = 3.14d0453 enddo454 !$omp end target teams distribute parallel do simd455 456 !ERROR: At most one NUM_TEAMS clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive457 !$omp target teams distribute parallel do simd num_teams(2) num_teams(3)458 do i = 1, N459 a(i) = 3.14d0460 enddo461 !$omp end target teams distribute parallel do simd462 463 !ERROR: The parameter of the NUM_TEAMS clause must be a positive integer expression464 !$omp target teams distribute parallel do simd num_teams(-1)465 do i = 1, N466 a(i) = 3.14d0467 enddo468 !$omp end target teams distribute parallel do simd469 470 !ERROR: At most one THREAD_LIMIT clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive471 !$omp target teams distribute parallel do simd thread_limit(2) thread_limit(3)472 do i = 1, N473 a(i) = 3.14d0474 enddo475 !$omp end target teams distribute parallel do simd476 477 !ERROR: The parameter of the THREAD_LIMIT clause must be a positive integer expression478 !$omp target teams distribute parallel do simd thread_limit(-1)479 do i = 1, N480 a(i) = 3.14d0481 enddo482 !$omp end target teams distribute parallel do simd483 484 !ERROR: At most one DEFAULT clause can appear on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive485 !$omp target teams distribute parallel do simd default(shared) default(private)486 do i = 1, N487 a(i) = 3.14d0488 enddo489 !$omp end target teams distribute parallel do simd490 491 !$omp target teams distribute parallel do simd num_teams(2) defaultmap(tofrom:scalar)492 do i = 1, N493 a(i) = 3.14d0494 enddo495 !$omp end target teams distribute parallel do simd496 497 !$omp target teams distribute parallel do simd map(tofrom:a)498 do i = 1, N499 a(i) = 3.14d0500 enddo501 !$omp end target teams distribute parallel do simd502 503 !ERROR: Only the ALLOC, FROM, TO, TOFROM map types are permitted for MAP clauses on the TARGET TEAMS DISTRIBUTE PARALLEL DO SIMD directive504 !$omp target teams distribute parallel do simd map(delete:a)505 do i = 1, N506 a(i) = 3.14d0507 enddo508 !$omp end target teams distribute parallel do simd509 510 511end program main512 513