aboutsummaryrefslogtreecommitdiff
path: root/flang/test/Semantics/OpenMP/loop-bind.f90
blob: 44d3f5788465df5997569cc11317c46b2ceb7376 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
! RUN: %python %S/../test_errors.py %s %flang -fopenmp -fopenmp-version=50

! OpenMP Version 5.0
! Check OpenMP construct validity for the following directives:
! 11.7 Loop directive

program main
  integer :: i, x

  !$omp teams
  !ERROR: `BIND(TEAMS)` must be specified since the `LOOP` region is strictly nested inside a `TEAMS` region.
  !$omp loop bind(thread)
  do i = 1, 10
    x = x + 1
  end do
  !$omp end loop
  !$omp end teams

  !ERROR: `BIND(TEAMS)` must be specified since the `LOOP` directive is combined with a `TEAMS` construct.
  !$omp target teams loop bind(thread)
  do i = 1, 10
    x = x + 1
  end do
  !$omp end target teams loop

  !ERROR: `BIND(TEAMS)` must be specified since the `LOOP` directive is combined with a `TEAMS` construct.
  !$omp teams loop bind(thread)
  do i = 1, 10
    x = x + 1
  end do
  !$omp end teams loop

  !ERROR: 'REDUCTION' clause not allowed with '!$OMP LOOP BIND(TEAMS)'.
  !$omp loop bind(teams) reduction(+: x)
  do i = 0, 10
    x = x + i
  end do
end program main