brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · e6238bb Raw
93 lines · plain
1! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp -fopenmp-version=522 3subroutine mod_task1(x)4  integer, intent(inout) :: x5 6  !Correct: "parallel" directive.7  !$omp parallel reduction(task, +:x)8  do i = 1, 1009    x = foo(i)10  enddo11  !$omp end parallel12end13 14subroutine mod_task2(x)15  integer, intent(inout) :: x16 17  !Correct: worksharing directive.18  !$omp sections reduction(task, +:x)19  do i = 1, 10020    x = foo(i)21  enddo22  !$omp end sections23end24 25subroutine mod_task3(x)26  integer, intent(inout) :: x27 28  !ERROR: Modifier 'TASK' on REDUCTION clause is only allowed with PARALLEL or worksharing directive29  !$omp simd reduction(task, +:x)30  do i = 1, 10031    x = foo(i)32  enddo33  !$omp end simd34end35 36subroutine mod_inscan1(x)37  integer, intent(inout) :: x38 39  !Correct: worksharing-loop directive40  !$omp do reduction(inscan, +:x)41  do i = 1, 10042    !$omp scan inclusive(x)43    x = foo(i)44  enddo45  !$omp end do46end47 48subroutine mod_inscan2(x)49  integer, intent(inout) :: x50 51  !Correct: worksharing-loop simd directive52  !$omp do simd reduction(inscan, +:x)53  do i = 1, 10054    !$omp scan inclusive(x)55    x = foo(i)56  enddo57  !$omp end do simd58end59 60subroutine mod_inscan3(x)61  integer, intent(inout) :: x62 63  !Correct: "simd" directive64  !$omp simd reduction(inscan, +:x)65  do i = 1, 10066    !$omp scan inclusive(x)67    x = foo(i)68  enddo69  !$omp end simd70end71 72subroutine mod_inscan4(x)73  integer, intent(inout) :: x74 75  !ERROR: Modifier 'INSCAN' on REDUCTION clause is only allowed with WORKSHARING LOOP, WORKSHARING LOOP SIMD, or SIMD directive76  !$omp parallel reduction(inscan, +:x)77  do i = 1, 10078    x = foo(i)79  enddo80  !$omp end parallel81end82 83subroutine mod_inscan5(x)84  integer, intent(inout) :: x85 86  !ERROR: Modifier 'INSCAN' on REDUCTION clause is only allowed with WORKSHARING LOOP, WORKSHARING LOOP SIMD, or SIMD directive87  !$omp sections reduction(inscan, +:x)88  do i = 1, 10089    x = foo(i)90  enddo91  !$omp end sections92end93