47 lines · plain
1! RUN: %python %S/../test_errors.py %s %flang -fopenmp2! This is not actually disallowed by the OpenMP standard, but it is not allowed3! for privatisation - this seems like an oversight.4 5module test6 integer :: a, b, c7 namelist /nlist1/ a, b8end module9 10program omp_reduction11 use test12 13 integer :: p(10) ,q(10)14 namelist /nlist2/ c, d15 16 a = 517 b = 1018 c = 10019 20 !ERROR: Variable 'd' in NAMELIST cannot be in a REDUCTION clause21 !ERROR: Variable 'a' in NAMELIST cannot be in a REDUCTION clause22 !$omp parallel reduction(+:d) reduction(+:a)23 d = a + b24 a = d25 !$omp end parallel26 27 call sb()28 29 contains30 subroutine sb()31 namelist /nlist3/ p, q32 33 !ERROR: Variable 'p' in NAMELIST cannot be in a REDUCTION clause34 !ERROR: Variable 'q' in NAMELIST cannot be in a REDUCTION clause35 !$omp parallel reduction(+:p) reduction(+:q)36 p = c * b37 q = p * d38 !$omp end parallel39 40 write(*, nlist1)41 write(*, nlist2)42 write(*, nlist3)43 44 end subroutine45 46end program omp_reduction47