2014-01-30 Alangi Derick <alangiderick@gmail.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / gomp / sharing-1.f90
blob7a107ffe7cbd9a61e8ef0530000a1cdaeb925966
1 ! { dg-do compile }
2 ! { dg-require-effective-target tls }
4 integer :: thrpriv, thr, i, j, s, g1, g2, m
5 integer, dimension (6) :: p
6 common /thrblk/ thr
7 common /gblk/ g1
8 save thrpriv, g2
9 !$omp threadprivate (/thrblk/, thrpriv)
10 s = 1
11 !$omp parallel do default (none) &
12 !$omp & private (p) shared (s) ! { dg-error "enclosing parallel" }
13 do i = 1, 64
14 call foo (thrpriv) ! Predetermined - threadprivate
15 call foo (thr) ! Predetermined - threadprivate
16 call foo (i) ! Predetermined - omp do iteration var
17 do j = 1, 64 ! Predetermined - sequential loop
18 call foo (j) ! iteration variable
19 end do
20 call bar ((/ (k * 4, k = 1, 8) /)) ! Predetermined - implied do
21 forall (l = 1 : i) &! Predetermined - forall indice
22 p(l) = 6 ! Explicitly determined - private
23 call foo (s) ! Explicitly determined - shared
24 call foo (g1) ! { dg-error "not specified in" }
25 call foo (g2) ! { dg-error "not specified in" }
26 call foo (m) ! { dg-error "not specified in" }
27 end do
28 end