1! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
2! OpenMP Version 4.5
3! 2.15.3.3 private Clause
4! Variables that appear in namelist statements may not appear in a private clause.
5
6module test
7  integer :: a, b, c
8  namelist /nlist1/ a, b
9end module
10
11program omp_private
12  use test
13
14  integer :: p(10) ,q(10)
15  namelist /nlist2/ c, d
16
17  a = 5
18  b = 10
19  c = 100
20
21  !ERROR: Variable 'a' in NAMELIST cannot be in a PRIVATE clause
22  !ERROR: Variable 'c' in NAMELIST cannot be in a PRIVATE clause
23  !$omp parallel private(a, c)
24  d = a + b
25  !$omp end parallel
26
27  call sb()
28
29  contains
30    subroutine sb()
31      namelist /nlist3/ p, q
32
33      !ERROR: Variable 'p' in NAMELIST cannot be in a PRIVATE clause
34      !ERROR: Variable 'd' in NAMELIST cannot be in a PRIVATE clause
35      !$omp parallel private(p, d)
36      p = c * b
37      q = p * d
38      !$omp end parallel
39
40      write(*, nlist1)
41      write(*, nlist2)
42      write(*, nlist3)
43
44    end subroutine
45
46end program omp_private
47