Fix gcc.c-torture/execute/ieee/cdivchkf.c on hpux
[official-gcc.git] / libgomp / testsuite / libgomp.fortran / reference1.f90
blob1d52c2fcdaa51dfa2e79c4942d5891ae2f34fd81
1 ! { dg-do run }
2 !$ use omp_lib
4 integer :: i, j, k
5 double precision :: d
6 i = 6
7 j = 19
8 k = 0
9 d = 24.5
10 call test (i, j, k, d)
11 if (i .ne. 38) stop 1
12 if (iand (k, 255) .ne. 0) stop 2
13 if (iand (k, 65280) .eq. 0) then
14 if (k .ne. 65536 * 4) stop 3
15 end if
16 contains
17 subroutine test (i, j, k, d)
18 integer :: i, j, k
19 double precision :: d
21 !$omp parallel firstprivate (d) private (j) num_threads (4) reduction (+:k)
22 if (i .ne. 6 .or. d .ne. 24.5 .or. k .ne. 0) k = k + 1
23 if (omp_get_num_threads () .ne. 4) k = k + 256
24 d = d / 2
25 j = 8
26 k = k + 65536
27 !$omp barrier
28 if (d .ne. 12.25 .or. j .ne. 8) k = k + 1
29 !$omp single
30 i = i + 32
31 !$omp end single nowait
32 !$omp end parallel
33 end subroutine test
34 end