brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1011 B · 61f790f Raw
40 lines · plain
1! RUN: %python %S/../test_errors.py %s %flang -fopenmp2! OpenMP Version 4.53! Variables that appear in expressions for statement function definitions4! may not appear in private, firstprivate or lastprivate clauses.5 6subroutine stmt_function(temp)7 8  integer :: i, p, q, r9  real :: c, f, s, v, t(10)10  real, intent(in) :: temp11 12  c(temp) = p * (temp - q) / r13  f(temp) = q + (temp * r/p)14  v(temp) = c(temp) + f(temp)/2 - s15 16  p = 517  q = 3218  r = 919 20  !ERROR: Variable 'p' in statement function expression cannot be in a PRIVATE clause21  !$omp parallel private(p)22  s = c(temp)23  !$omp end parallel24 25  !ERROR: Variable 's' in statement function expression cannot be in a FIRSTPRIVATE clause26  !$omp parallel firstprivate(s)27  s = s + f(temp)28  !$omp end parallel29 30  !ERROR: Variable 's' in statement function expression cannot be in a LASTPRIVATE clause31  !$omp parallel do lastprivate(s, t)32  do i = 1, 1033  t(i) = v(temp) + i - s34  end do35  !$omp end parallel do36 37  print *, t38 39end subroutine stmt_function40