154 lines · plain
1! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp2! OpenMP Version 4.53! Various checks with the nesting of MASTER construct4 5program omp_nest_master6 integer i, k, j7 k = 0;8 9 !$omp do10 do i = 1, 1011 k = k + 112 !ERROR: `MASTER` region may not be closely nested inside of `WORKSHARING`, `LOOP`, `TASK`, `TASKLOOP`, or `ATOMIC` region.13 !$omp master14 j = j -115 !$omp end master16 end do17 18 !$omp sections 19 !ERROR: `MASTER` region may not be closely nested inside of `WORKSHARING`, `LOOP`, `TASK`, `TASKLOOP`, or `ATOMIC` region.20 !$omp master21 do i = 1, 1022 k = k + 123 end do24 !$omp end master25 !$omp end sections26 27 !$omp single 28 !ERROR: `MASTER` region may not be closely nested inside of `WORKSHARING`, `LOOP`, `TASK`, `TASKLOOP`, or `ATOMIC` region.29 !$omp master30 do i = 1, 1031 k = k + 132 end do33 !$omp end master34 !$omp end single35 36 37 38 !$omp task39 do i = 1, 1040 k = k + 141 !ERROR: `MASTER` region may not be closely nested inside of `WORKSHARING`, `LOOP`, `TASK`, `TASKLOOP`, or `ATOMIC` region.42 !$omp master43 j = j -144 !$omp end master45 end do46 !$omp end task47 48 !$omp taskloop49 do i = 1, 1050 k = k + 151 !ERROR: `MASTER` region may not be closely nested inside of `WORKSHARING`, `LOOP`, `TASK`, `TASKLOOP`, or `ATOMIC` region.52 !$omp master53 j = j -154 !$omp end master55 end do56 !$omp end taskloop57 58 !$omp target parallel do simd59 do i = 1, 1060 k = k + 161 !ERROR: The only OpenMP constructs that can be encountered during execution of a 'SIMD' region are the `ATOMIC` construct, the `LOOP` construct, the `SIMD` construct, the `SCAN` construct and the `ORDERED` construct with the `SIMD` clause.62 !ERROR: `MASTER` region may not be closely nested inside of `WORKSHARING`, `LOOP`, `TASK`, `TASKLOOP`, or `ATOMIC` region.63 !$omp master64 j = j -165 !$omp end master66 end do67 !$omp end target parallel do simd68 69 !$omp critical70 do i = 1, 1071 k = k + 172 !$omp master73 j = j -174 !$omp end master75 end do76 !$omp end critical77 78 !$omp ordered79 do i = 1, 1080 k = k + 181 !$omp master82 j = j -183 !$omp end master84 end do85 !$omp end ordered86 87 !$omp ordered88 do i = 1, 1089 !ERROR: TEAMS region can only be strictly nested within the implicit parallel region or TARGET region90 !$omp teams91 !$omp distribute92 do k =1, 1093 print *, "hello"94 !$omp master95 j = j -196 !$omp end master97 end do98 !$omp end distribute99 !$omp end teams100 end do101 !$omp end ordered102 103 !$omp critical104 do i = 1, 10105 !ERROR: TEAMS region can only be strictly nested within the implicit parallel region or TARGET region106 !$omp teams107 !$omp distribute108 do k =1, 10109 print *, "hello"110 !$omp master111 j = j -1112 !$omp end master113 end do114 !$omp end distribute115 !$omp end teams116 end do117 !$omp end critical118 119 !$omp taskloop120 do i = 1, 10121 !ERROR: TEAMS region can only be strictly nested within the implicit parallel region or TARGET region122 !$omp teams123 !$omp distribute124 do k =1, 10125 print *, "hello"126 !ERROR: `MASTER` region may not be closely nested inside of `WORKSHARING`, `LOOP`, `TASK`, `TASKLOOP`, or `ATOMIC` region.127 !$omp master128 j = j -1129 !$omp end master130 end do131 !$omp end distribute132 !$omp end teams133 end do134 !$omp end taskloop135 136 !$omp task137 do i = 1, 10138 !ERROR: TEAMS region can only be strictly nested within the implicit parallel region or TARGET region139 !$omp teams140 !$omp distribute141 do k =1, 10142 print *, "hello"143 !ERROR: `MASTER` region may not be closely nested inside of `WORKSHARING`, `LOOP`, `TASK`, `TASKLOOP`, or `ATOMIC` region.144 !$omp master145 j = j -1146 !$omp end master147 end do148 !$omp end distribute149 !$omp end teams150 end do151 !$omp end task152 153end program omp_nest_master154