aarch64: Optimise calls to ldexp with SVE FSCALE instruction [PR111733]
[official-gcc.git] / libgomp / testsuite / libgomp.fortran / nested1.f90
blobbb3d0ed279785165fd2ab1b36040fa0ab982a54f
1 ! { dg-do run }
2 ! { dg-additional-options "-Wno-deprecated-declarations" }
4 program nested1
5 use omp_lib
6 integer :: e1, e2, e3, e
7 integer :: tn1, tn2, tn3
8 e1 = 0
9 e2 = 0
10 e3 = 0
11 call omp_set_nested (.true.)
12 call omp_set_dynamic (.false.)
13 if (omp_in_parallel ()) stop 1
14 if (omp_get_num_threads ().ne.1) stop 2
15 if (omp_get_level ().ne.0) stop 3
16 if (omp_get_ancestor_thread_num (0).ne.0) stop 4
17 if (omp_get_ancestor_thread_num (-1).ne.-1) stop 5
18 if (omp_get_ancestor_thread_num (1).ne.-1) stop 6
19 if (omp_get_team_size (0).ne.1) stop 7
20 if (omp_get_team_size (-1).ne.-1) stop 8
21 if (omp_get_team_size (1).ne.-1) stop 9
22 if (omp_get_active_level ().ne.0) stop 10
23 !$omp parallel num_threads (4) private (e, tn1)
24 e = 0
25 tn1 = omp_get_thread_num ()
26 if (.not.omp_in_parallel ()) e = e + 1
27 if (omp_get_num_threads ().ne.4) e = e + 1
28 if (tn1.lt.0.or.tn1.ge.4) e = e + 1
29 if (omp_get_level ().ne.1) e = e + 1
30 if (omp_get_ancestor_thread_num (0).ne.0) e = e + 1
31 if (omp_get_ancestor_thread_num (1).ne.tn1) e = e + 1
32 if (omp_get_ancestor_thread_num (-1).ne.-1) e = e + 1
33 if (omp_get_ancestor_thread_num (2).ne.-1) e = e + 1
34 if (omp_get_team_size (0).ne.1) e = e + 1
35 if (omp_get_team_size (1).ne.4) e = e + 1
36 if (omp_get_team_size (-1).ne.-1) e = e + 1
37 if (omp_get_team_size (2).ne.-1) e = e + 1
38 if (omp_get_active_level ().ne.1) e = e + 1
39 !$omp atomic
40 e1 = e1 + e
41 !$omp parallel num_threads (5) if (.false.) firstprivate (tn1) &
42 !$omp& private (e, tn2)
43 e = 0
44 tn2 = omp_get_thread_num ()
45 if (.not.omp_in_parallel ()) e = e + 1
46 if (omp_get_num_threads ().ne.1) e = e + 1
47 if (tn2.ne.0) e = e + 1
48 if (omp_get_level ().ne.2) e = e + 1
49 if (omp_get_ancestor_thread_num (0).ne.0) e = e + 1
50 if (omp_get_ancestor_thread_num (1).ne.tn1) e = e + 1
51 if (omp_get_ancestor_thread_num (2).ne.tn2) e = e + 1
52 if (omp_get_ancestor_thread_num (-1).ne.-1) e = e + 1
53 if (omp_get_ancestor_thread_num (3).ne.-1) e = e + 1
54 if (omp_get_team_size (0).ne.1) e = e + 1
55 if (omp_get_team_size (1).ne.4) e = e + 1
56 if (omp_get_team_size (2).ne.1) e = e + 1
57 if (omp_get_team_size (-1).ne.-1) e = e + 1
58 if (omp_get_team_size (3).ne.-1) e = e + 1
59 if (omp_get_active_level ().ne.1) e = e + 1
60 !$omp atomic
61 e2 = e2 + e
62 !$omp parallel num_threads (2) firstprivate (tn1, tn2) &
63 !$omp& private (e, tn3)
64 e = 0
65 tn3 = omp_get_thread_num ()
66 if (.not.omp_in_parallel ()) e = e + 1
67 if (omp_get_num_threads ().ne.2) e = e + 1
68 if (tn3.lt.0.or.tn3.ge.2) e = e + 1
69 if (omp_get_level ().ne.3) e = e + 1
70 if (omp_get_ancestor_thread_num (0).ne.0) e = e + 1
71 if (omp_get_ancestor_thread_num (1).ne.tn1) e = e + 1
72 if (omp_get_ancestor_thread_num (2).ne.tn2) e = e + 1
73 if (omp_get_ancestor_thread_num (3).ne.tn3) e = e + 1
74 if (omp_get_ancestor_thread_num (-1).ne.-1) e = e + 1
75 if (omp_get_ancestor_thread_num (4).ne.-1) e = e + 1
76 if (omp_get_team_size (0).ne.1) e = e + 1
77 if (omp_get_team_size (1).ne.4) e = e + 1
78 if (omp_get_team_size (2).ne.1) e = e + 1
79 if (omp_get_team_size (3).ne.2) e = e + 1
80 if (omp_get_team_size (-1).ne.-1) e = e + 1
81 if (omp_get_team_size (4).ne.-1) e = e + 1
82 if (omp_get_active_level ().ne.2) e = e + 1
83 !$omp atomic
84 e3 = e3 + e
85 !$omp end parallel
86 !$omp end parallel
87 !$omp end parallel
88 if (e1.ne.0.or.e2.ne.0.or.e3.ne.0) stop 11
89 end program nested1