[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / omp-flush01.f90
blob03b02680831875ee1dab8bfc49780987e32b01dd
1 ! RUN: %S/test_errors.sh %s %t %flang -fopenmp
2 ! REQUIRES: shell
4 ! 2.17.8 Flush construct [OpenMP 5.0]
5 ! memory-order-clause ->
6 ! acq_rel
7 ! release
8 ! acquire
9 use omp_lib
10 implicit none
12 integer :: i, a, b
13 real, DIMENSION(10) :: array
15 a = 1.0
16 !$omp parallel num_threads(4)
17 !Only memory-order-clauses.
18 if (omp_get_thread_num() == 1) then
19 ! Allowed clauses.
20 !$omp flush acq_rel
21 array = (/1, 2, 3, 4, 5, 6, 7, 8, 9, 10/)
22 !$omp flush release
23 array = (/1, 2, 3, 4, 5, 6, 7, 8, 9, 10/)
24 !$omp flush acquire
26 !ERROR: expected end of line
27 !$omp flush private(array)
28 !ERROR: expected end of line
29 !$omp flush num_threads(4)
31 ! Mix allowed and not allowed clauses.
32 !ERROR: expected end of line
33 !$omp flush num_threads(4) acquire
34 end if
35 !$omp end parallel
36 end