[WebAssembly] Fix asan issue from https://reviews.llvm.org/D121349
[llvm-project.git] / flang / test / Semantics / omp-flush01.f90
blob1eb9680d8b04760b1a6d7d0cff00dd7eca5dd89a
1 ! RUN: %python %S/test_errors.py %s %flang -fopenmp
3 ! 2.17.8 Flush construct [OpenMP 5.0]
4 ! memory-order-clause ->
5 ! acq_rel
6 ! release
7 ! acquire
8 use omp_lib
9 implicit none
11 integer :: i, a, b
12 real, DIMENSION(10) :: array
14 a = 1.0
15 !$omp parallel num_threads(4)
16 !Only memory-order-clauses.
17 if (omp_get_thread_num() == 1) then
18 ! Allowed clauses.
19 !$omp flush acq_rel
20 array = (/1, 2, 3, 4, 5, 6, 7, 8, 9, 10/)
21 !$omp flush release
22 array = (/1, 2, 3, 4, 5, 6, 7, 8, 9, 10/)
23 !$omp flush acquire
25 !ERROR: expected end of line
26 !$omp flush private(array)
27 !ERROR: expected end of line
28 !$omp flush num_threads(4)
30 ! Mix allowed and not allowed clauses.
31 !ERROR: expected end of line
32 !$omp flush num_threads(4) acquire
33 end if
34 !$omp end parallel
35 end