[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / OpenMP / omp-private02.f90
bloba81e31998eebb65931f56ccd7b14cdc1f8e2ad8f
1 ! RUN: %python %S/../test_errors.py %s %flang -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.
6 module test
7 integer :: a, b, c
8 namelist /nlist1/ a, b
9 end module
11 program omp_private
12 use test
14 integer :: p(10) ,q(10)
15 namelist /nlist2/ c, d
17 a = 5
18 b = 10
19 c = 100
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
27 call sb()
29 contains
30 subroutine sb()
31 namelist /nlist3/ p, q
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
40 write(*, nlist1)
41 write(*, nlist2)
42 write(*, nlist3)
44 end subroutine
46 end program omp_private