[4/n] PR85694: Remove redundant calls to types_compatible_p
[official-gcc.git] / libgomp / testsuite / libgomp.fortran / allocatable2.f90
blob1361e6d1a919058ea9d0f9ee5368ec5741482112
1 ! { dg-do run }
2 ! { dg-require-effective-target tls_runtime }
3 !$ use omp_lib
5 integer, save, allocatable :: a(:, :)
6 integer, allocatable :: b(:, :)
7 integer :: n
8 logical :: l
9 !$omp threadprivate (a)
10 if (allocated (a)) STOP 1
11 call omp_set_dynamic (.false.)
12 l = .false.
13 !$omp parallel num_threads (4) reduction(.or.:l)
14 allocate (a(-1:1, 7:10))
15 a(:, :) = omp_get_thread_num () + 6
16 l = l.or..not.allocated (a)
17 l = l.or.size(a).ne.12.or.size(a,1).ne.3.or.size(a,2).ne.4
18 !$omp end parallel
19 if (l.or.any(a.ne.6)) STOP 1
20 !$omp parallel num_threads (4) copyin (a) reduction(.or.:l) private (b)
21 l = l.or.allocated (b)
22 l = l.or..not.allocated (a)
23 l = l.or.size(a).ne.12.or.size(a,1).ne.3.or.size(a,2).ne.4
24 l = l.or.any(a.ne.6)
25 allocate (b(1, 3))
26 a(:, :) = omp_get_thread_num () + 36
27 b(:, :) = omp_get_thread_num () + 66
28 !$omp single
29 n = omp_get_thread_num ()
30 !$omp end single copyprivate (a, b)
31 l = l.or..not.allocated (a)
32 l = l.or.size(a).ne.12.or.size(a,1).ne.3.or.size(a,2).ne.4
33 l = l.or.any(a.ne.(n + 36))
34 l = l.or..not.allocated (b)
35 l = l.or.size(b).ne.3.or.size(b,1).ne.1.or.size(b,2).ne.3
36 l = l.or.any(b.ne.(n + 66))
37 deallocate (b)
38 l = l.or.allocated (b)
39 !$omp end parallel
40 if (n.lt.0 .or. n.ge.4) STOP 2
41 if (l.or.any(a.ne.(n + 36))) STOP 3
42 !$omp parallel num_threads (4) reduction(.or.:l)
43 deallocate (a)
44 l = l.or.allocated (a)
45 !$omp end parallel
46 if (l.or.allocated (a)) STOP 4
47 end