114 lines · plain
1! RUN: %python %S/../test_errors.py %s %flang -fopenmp2 3! OpenMP Version 5.04! Check OpenMP construct validity for the following directives:5! 2.7 Teams Construct6 7program main8 integer :: i, j, N = 109 real :: a, b, c10 11 !$omp teams12 a = 3.1413 !$omp end teams14 15 !$omp target16 !$omp teams17 a = 3.1418 !$omp end teams19 !$omp end target20 21 !$omp target22 !$omp parallel23 !ERROR: TEAMS region can only be strictly nested within the implicit parallel region or TARGET region24 !$omp teams25 a = 3.1426 !$omp end teams27 !$omp end parallel28 !$omp end target29 30 !$omp parallel31 !ERROR: TEAMS region can only be strictly nested within the implicit parallel region or TARGET region32 !$omp teams33 a = 3.1434 !$omp end teams35 !$omp end parallel36 37 !$omp do38 do i = 1, N39 !ERROR: TEAMS region can only be strictly nested within the implicit parallel region or TARGET region40 !$omp teams41 a = 3.1442 !$omp end teams43 end do44 45 !$omp master46 !ERROR: TEAMS region can only be strictly nested within the implicit parallel region or TARGET region47 !$omp teams48 a = 3.1449 !$omp end teams50 !$omp end master51 52 !$omp target parallel53 !ERROR: TEAMS region can only be strictly nested within the implicit parallel region or TARGET region54 !$omp teams55 a = 3.1456 !$omp end teams57 !$omp end target parallel58 59 !$omp target60 !$omp teams61 !ERROR: Only `DISTRIBUTE`, `PARALLEL`, or `LOOP` regions are allowed to be strictly nested inside `TEAMS` region.62 !ERROR: TEAMS region can only be strictly nested within the implicit parallel region or TARGET region63 !$omp teams64 a = 3.1465 !$omp end teams66 !$omp end teams67 !$omp end target68 69 !$omp target teams70 !ERROR: Only `DISTRIBUTE`, `PARALLEL`, or `LOOP` regions are allowed to be strictly nested inside `TEAMS` region.71 !ERROR: TEAMS region can only be strictly nested within the implicit parallel region or TARGET region72 !$omp teams73 a = 3.1474 !$omp end teams75 !$omp end target teams76 77 !ERROR: TARGET construct with nested TEAMS region contains statements or directives outside of the TEAMS construct78 !$omp target79 do i = 1, N80 !$omp teams81 a = 3.1482 !$omp end teams83 enddo84 !$omp end target85 86 !ERROR: TARGET construct with nested TEAMS region contains statements or directives outside of the TEAMS construct87 !$omp target88 if (i .GT. 1) then89 if (j .GT. 1) then90 !$omp teams91 a = 3.1492 !$omp end teams93 end if94 end if95 !$omp end target96 97 !ERROR: TARGET construct with nested TEAMS region contains statements or directives outside of the TEAMS construct98 !$omp target99 b = 3.14100 !$omp teams101 a = 3.14102 !$omp end teams103 !$omp end target104 105 !ERROR: TARGET construct with nested TEAMS region contains statements or directives outside of the TEAMS construct106 !$omp target107 !$omp teams108 a = 3.14109 !$omp end teams110 c = 3.14111 !$omp end target112 113end program main114