1! RUN: %S/test_errors.sh %s %t %flang -fopenmp
2! REQUIRES: shell
3! OpenMP Version 4.5
4! 2.7.1 Loop Construct
5! The ordered clause must be present on the loop construct if any ordered
6! region ever binds to a loop region arising from the loop construct.
7
8program omp_do
9  integer i, j, k
10
11  !$omp do
12  do i = 1, 10
13    !ERROR: The ORDERED clause must be present on the loop construct if any ORDERED region ever binds to a loop region arising from the loop construct.
14    !$omp ordered
15    call my_func()
16    !$omp end ordered
17  end do
18  !$omp end do
19
20  !$omp do ordered private(i)
21  do i = 1, 10
22    !$omp parallel do
23    do j = 1, 10
24      print *,i
25      !ERROR: The ORDERED clause must be present on the loop construct if any ORDERED region ever binds to a loop region arising from the loop construct.
26      !$omp ordered
27      print *,i
28      !$omp end ordered
29    end do
30    !$omp end parallel do
31  end do
32  !$omp end do
33
34end program omp_do
35