Fix gcc.c-torture/execute/ieee/cdivchkf.c on hpux
[official-gcc.git] / libgomp / testsuite / libgomp.fortran / nestedfn2.f90
blobcd2e505a6e65a0f169067966a4246aeb0c73b5a1
1 ! { dg-do run }
3 integer :: i
4 common /c/ i
5 i = -1
6 !$omp parallel shared (i) num_threads (4)
7 call test1
8 !$omp end parallel
9 end
10 subroutine test1
11 integer :: vari
12 call test2
13 call test3
14 contains
15 subroutine test2
16 use omp_lib
17 integer :: i
18 common /c/ i
19 !$omp single
20 i = omp_get_thread_num ()
21 call test4
22 !$omp end single copyprivate (vari)
23 end subroutine test2
24 subroutine test3
25 integer :: i
26 common /c/ i
27 if (i .lt. 0 .or. i .ge. 4) stop 1
28 if (i + 10 .ne. vari) stop 2
29 end subroutine test3
30 subroutine test4
31 use omp_lib
32 vari = omp_get_thread_num () + 10
33 end subroutine test4
34 end subroutine test1