[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / omp-private02.f90
blobdb8c733cf9b36f47ba270db3d92102322d92b71d
1 ! RUN: %S/test_errors.sh %s %t %flang -fopenmp
2 ! REQUIRES: shell
3 ! OpenMP Version 4.5
4 ! 2.15.3.3 private Clause
5 ! Variables that appear in namelist statements may not appear in a private clause.
7 module test
8 integer :: a, b, c
9 namelist /nlist1/ a, b
10 end module
12 program omp_private
13 use test
15 integer :: p(10) ,q(10)
16 namelist /nlist2/ c, d
18 a = 5
19 b = 10
20 c = 100
22 !ERROR: Variable 'a' in NAMELIST cannot be in a PRIVATE clause
23 !ERROR: Variable 'c' in NAMELIST cannot be in a PRIVATE clause
24 !$omp parallel private(a, c)
25 d = a + b
26 !$omp end parallel
28 call sb()
30 contains
31 subroutine sb()
32 namelist /nlist3/ p, q
34 !ERROR: Variable 'p' in NAMELIST cannot be in a PRIVATE clause
35 !ERROR: Variable 'd' in NAMELIST cannot be in a PRIVATE clause
36 !$omp parallel private(p, d)
37 p = c * b
38 q = p * d
39 !$omp end parallel
41 write(*, nlist1)
42 write(*, nlist2)
43 write(*, nlist3)
45 end subroutine
47 end program omp_private