xref: /llvm-project/flang/test/Semantics/OpenMP/do10.f90 (revision 502bea25bdc07d1811b8bfea1c2e6bfa8617f72f)
1! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
2! OpenMP Version 4.5
3! 2.7.1 Loop Construct
4! The DO loop iteration variable must be of type integer.
5
6program omp_do
7  real i, j, k
8  !$omp do
9  !ERROR: The DO loop iteration variable must be of the type integer.
10  do i = 1, 10
11    !ERROR: The DO loop iteration variable must be of the type integer.
12    do j = 1, 10
13      print *, "it", i, j
14    end do
15  end do
16  !$omp end do
17
18  !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.
19  !$omp do collapse(3)
20  !ERROR: The DO loop iteration variable must be of the type integer.
21  do i = 1, 10
22    !ERROR: The DO loop iteration variable must be of the type integer.
23    do j = 1, 10
24      print *, "it", i, j
25    end do
26  end do
27  !$omp end do
28
29  !$omp do collapse(2)
30  !ERROR: The DO loop iteration variable must be of the type integer.
31  do i = 1, 10
32    !ERROR: The DO loop iteration variable must be of the type integer.
33    do j = 1, 10
34      print *, "it", i, j
35    end do
36  end do
37  !$omp end do
38
39end program omp_do
40