2014-01-30 Alangi Derick <alangiderick@gmail.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / gomp / proc_ptr_1.f90
blob952c31491edece0261c151ef464be46f11489ff0
1 ! { dg-do compile }
3 ! PR 46271: [F03] OpenMP default(none) and procedure pointers
5 ! Contributed by Marco Restelli <mrestelli@gmail.com>
7 program test
8 implicit none
9 integer :: i
10 real :: s(1000)
11 procedure(f), pointer :: pf
13 pf => f
15 !$omp parallel do schedule(static) private(i) shared(s,pf) default(none)
16 do i=1,1000
17 call pf(real(i),s(i))
18 enddo
19 !$omp end parallel do
21 write(*,*) 'Sum ',sum(s)
22 contains
23 pure subroutine f(x,y)
24 real, intent(in) :: x
25 real, intent(out) :: y
26 y = sin(x)*cos(x)
27 end subroutine
28 end