2010-12-20 Tobias Burnus <burnus@net-b.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / gomp / sharing-3.f90
blob05be38283a9388a606dd9ab2e4637c17e61df955
1 ! { dg-do compile }
2 ! { dg-options "-fopenmp" }
4 subroutine foo (vara, varb, varc, vard, n)
5 integer :: n, vara(n), varb(*), varc(:), vard(6), vare(6)
6 vare(:) = 0
7 !$omp parallel default(none) shared(vara, varb, varc, vard, vare)
8 !$omp master
9 vara(1) = 1
10 varb(1) = 1
11 varc(1) = 1
12 vard(1) = 1
13 vare(1) = 1
14 !$omp end master
15 !$omp end parallel
16 !$omp parallel default(none) private(vara, varc, vard, vare)
17 vara(1) = 1
18 varc(1) = 1
19 vard(1) = 1
20 vare(1) = 1
21 !$omp end parallel
22 !$omp parallel default(none) firstprivate(vara, varc, vard, vare)
23 vara(1) = 1
24 varc(1) = 1
25 vard(1) = 1
26 vare(1) = 1
27 !$omp end parallel
28 !$omp parallel default(none) ! { dg-error "enclosing parallel" }
29 !$omp master
30 vara(1) = 1 ! { dg-error "not specified" }
31 varb(1) = 1 ! Assumed-size is predetermined
32 varc(1) = 1 ! { dg-error "not specified" }
33 vard(1) = 1 ! { dg-error "not specified" }
34 vare(1) = 1 ! { dg-error "not specified" }
35 !$omp end master
36 !$omp end parallel
37 end subroutine foo