1!RUN: %python %S/../test_errors.py %s %flang -fopenmp
2! OpenMP Version 4.5
3! 2.7.1 Collapse Clause
4program omp_doCollapse
5  integer:: i,j
6  !ERROR: The value of the parameter in the COLLAPSE or ORDERED clause must not be larger than the number of nested loops following the construct.
7  !$omp do collapse(3)
8  do i = 1,10
9    do j = 1, 10
10      print *, "hello"
11    end do
12  end do
13  !$omp end do
14
15  do i = 1,10
16    do j = 1, 10
17      !ERROR: The value of the parameter in the COLLAPSE or ORDERED clause must not be larger than the number of nested loops following the construct.
18      !$omp do collapse(2)
19      do k = 1, 10
20        print *, "hello"
21      end do
22      !$omp end do
23    end do
24  end do
25end program omp_doCollapse
26
27