Support -std=f2018
[official-gcc.git] / libgomp / testsuite / libgomp.fortran / workshare1.f90
bloba0e6ff919e517c29cd9989a5ce51d610833b6424
1 function foo ()
2 integer :: foo
3 logical :: foo_seen
4 common /foo_seen/ foo_seen
5 foo_seen = .true.
6 foo = 3
7 end
8 function bar ()
9 integer :: bar
10 logical :: bar_seen
11 common /bar_seen/ bar_seen
12 bar_seen = .true.
13 bar = 3
14 end
15 integer :: a (10), b (10), foo, bar
16 logical :: foo_seen, bar_seen
17 common /foo_seen/ foo_seen
18 common /bar_seen/ bar_seen
20 foo_seen = .false.
21 bar_seen = .false.
22 !$omp parallel workshare if (foo () .gt. 2) num_threads (bar () + 1)
23 a = 10
24 b = 20
25 a(1:5) = max (a(1:5), b(1:5))
26 !$omp end parallel workshare
27 if (any (a(1:5) .ne. 20)) call abort
28 if (any (a(6:10) .ne. 10)) call abort
29 if (.not. foo_seen .or. .not. bar_seen) call abort
30 end