39 lines · plain
1! REQUIRES: openmp_runtime2 3! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags -fopenmp-version=504 5! 2.17.8 Flush construct [OpenMP 5.0]6! memory-order-clause ->7! acq_rel8! release9! acquire10use omp_lib11 implicit none12 13 integer :: i, a, b14 real, DIMENSION(10) :: array15 16 a = 1.017 !$omp parallel num_threads(4)18 !Only memory-order-clauses.19 if (omp_get_thread_num() == 1) then20 ! Allowed clauses.21 !$omp flush acq_rel22 array = (/1, 2, 3, 4, 5, 6, 7, 8, 9, 10/)23 !$omp flush release24 array = (/1, 2, 3, 4, 5, 6, 7, 8, 9, 10/)25 !$omp flush acquire26 27 !ERROR: PRIVATE clause is not allowed on the FLUSH directive28 !$omp flush private(array)29 !ERROR: NUM_THREADS clause is not allowed on the FLUSH directive30 !$omp flush num_threads(4)31 32 ! Mix allowed and not allowed clauses.33 !ERROR: NUM_THREADS clause is not allowed on the FLUSH directive34 !$omp flush num_threads(4) acquire35 end if36 !$omp end parallel37end38 39