2014-01-30 Alangi Derick <alangiderick@gmail.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / gomp / workshare1.f90
blobffbb1db8211bc2ecb338e407dbebf7a36f1958cf
1 ! { dg-do compile }
3 interface
4 subroutine foo
5 end subroutine
6 function bar ()
7 integer :: bar
8 end function bar
9 elemental function baz ()
10 integer :: baz
11 end function baz
12 end interface
14 integer :: i, j
15 real :: a, b (10), c
16 a = 0.5
17 b = 0.25
18 !$omp parallel workshare
19 a = sin (a)
20 b = sin (b)
21 forall (i = 1:10) b(i) = cos (b(i)) - 0.5
22 j = baz ()
23 !$omp parallel if (bar () .gt. 2) &
24 !$omp & num_threads (bar () + 1)
25 i = bar ()
26 !$omp end parallel
27 !$omp parallel do schedule (static, bar () + 4)
28 do j = 1, 10
29 i = bar ()
30 end do
31 !$omp end parallel do
32 !$omp end parallel workshare
33 !$omp parallel workshare
34 call foo ! { dg-error "CALL statement" }
35 i = bar () ! { dg-error "non-ELEMENTAL" }
36 !$omp critical
37 i = bar () ! { dg-error "non-ELEMENTAL" }
38 !$omp end critical
39 !$omp atomic
40 j = j + bar () ! { dg-error "non-ELEMENTAL" }
41 !$omp end parallel workshare
42 end