config.cc (m68hc11, [...]): Add usegas.h, rename tmake_file to m68hc11/t-m68hc11.
[official-gcc.git] / libgomp / testsuite / libgomp.fortran / reduction4.f90
blobbb1ed0e209cf48e54a03b08c0969429a7d679dbf
1 ! { dg-do run }
2 !$ use omp_lib
4 integer (kind = 4) :: i, ia (6), j, ja (6), k, ka (6), ta (6), n, cnt, x
5 logical :: v
7 i = Z'ffff0f'
8 ia = Z'f0ff0f'
9 j = Z'0f0000'
10 ja = Z'0f5a00'
11 k = Z'055aa0'
12 ka = Z'05a5a5'
13 v = .false.
14 cnt = -1
15 x = not(0)
17 !$omp parallel num_threads (3) private (n) reduction (.or.:v) &
18 !$omp & reduction (iand:i, ia) reduction (ior:j, ja) reduction (ieor:k, ka)
19 !$ if (i .ne. x .or. any (ia .ne. x)) v = .true.
20 !$ if (j .ne. 0 .or. any (ja .ne. 0)) v = .true.
21 !$ if (k .ne. 0 .or. any (ka .ne. 0)) v = .true.
22 n = omp_get_thread_num ()
23 if (n .eq. 0) then
24 cnt = omp_get_num_threads ()
25 i = Z'ff7fff'
26 ia(3:5) = Z'fffff1'
27 j = Z'078000'
28 ja(1:3) = 1
29 k = Z'78'
30 ka(3:6) = Z'f0f'
31 else if (n .eq. 1) then
32 i = Z'ffff77'
33 ia(2:5) = Z'ffafff'
34 j = Z'007800'
35 ja(2:5) = 8
36 k = Z'57'
37 ka(3:4) = Z'f0108'
38 else
39 i = Z'777fff'
40 ia(1:2) = Z'fffff3'
41 j = Z'000780'
42 ja(5:6) = Z'f00'
43 k = Z'1000'
44 ka(6:6) = Z'777'
45 end if
46 !$omp end parallel
47 if (v) call abort
48 if (cnt .eq. 3) then
49 ta = (/Z'f0ff03', Z'f0af03', Z'f0af01', Z'f0af01', Z'f0af01', Z'f0ff0f'/)
50 if (i .ne. Z'777f07' .or. any (ia .ne. ta)) call abort
51 ta = (/Z'f5a01', Z'f5a09', Z'f5a09', Z'f5a08', Z'f5f08', Z'f5f00'/)
52 if (j .ne. Z'fff80' .or. any (ja .ne. ta)) call abort
53 ta = (/Z'5a5a5', Z'5a5a5', Z'aaba2', Z'aaba2', Z'5aaaa', Z'5addd'/)
54 if (k .ne. Z'54a8f' .or. any (ka .ne. ta)) call abort
55 end if
56 end