55 lines · plain
1! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp -fopenmp-version=522!3! OpenMP Version 5.24!5! 2.10.2 single Construct6! Copyprivate and Nowait clauses are allowed in both clause and end clause7 8subroutine omp_single9 integer, save :: i10 integer :: j11 i = 10; j = 1112 13 !ERROR: COPYPRIVATE variable 'i' is not PRIVATE or THREADPRIVATE in outer context14 !ERROR: NOWAIT clause must not be used with COPYPRIVATE clause on the SINGLE directive15 !$omp single copyprivate(i) nowait16 print *, "omp single", i17 !$omp end single18 19 !$omp parallel private(i)20 !$omp single copyprivate(i)21 print *, "omp single", i22 !$omp end single23 !$omp end parallel24 25 !$omp parallel26 !ERROR: NOWAIT clause must not be used with COPYPRIVATE clause on the SINGLE directive27 !$omp single nowait28 print *, "omp single", i29 !ERROR: COPYPRIVATE variable 'i' is not PRIVATE or THREADPRIVATE in outer context30 !$omp end single copyprivate(i)31 32 !ERROR: COPYPRIVATE variable 'i' is not PRIVATE or THREADPRIVATE in outer context33 !$omp single copyprivate(i)34 print *, "omp single", i35 !ERROR: NOWAIT clause must not be used with COPYPRIVATE clause on the SINGLE directive36 !$omp end single nowait37 38 !ERROR: COPYPRIVATE variable 'j' may not appear on a PRIVATE or FIRSTPRIVATE clause on a SINGLE construct39 !$omp single private(j) copyprivate(j)40 print *, "omp single", j41 !ERROR: COPYPRIVATE variable 'j' may not appear on a PRIVATE or FIRSTPRIVATE clause on a SINGLE construct42 !WARNING: The COPYPRIVATE clause with 'j' is already used on the SINGLE directive [-Wopen-mp-usage]43 !$omp end single copyprivate(j)44 45 !$omp single nowait46 print *, "omp single", j47 !ERROR: At most one NOWAIT clause can appear on the SINGLE directive48 !$omp end single nowait49 !$omp end parallel50 51 !$omp single nowait52 print *, "omp single", i53 !$omp end single54end subroutine omp_single55