| 1 |
! { dg-do run } |
| 2 |
function foo () |
| 3 |
integer :: foo |
| 4 |
logical :: foo_seen |
| 5 |
common /foo_seen/ foo_seen |
| 6 |
foo_seen = .true. |
| 7 |
foo = 3 |
| 8 |
end |
| 9 |
function bar () |
| 10 |
integer :: bar |
| 11 |
logical :: bar_seen |
| 12 |
common /bar_seen/ bar_seen |
| 13 |
bar_seen = .true. |
| 14 |
bar = 3 |
| 15 |
end |
| 16 |
integer :: a (10), b (10), foo, bar |
| 17 |
logical :: foo_seen, bar_seen |
| 18 |
common /foo_seen/ foo_seen |
| 19 |
common /bar_seen/ bar_seen |
| 20 |
|
| 21 |
foo_seen = .false. |
| 22 |
bar_seen = .false. |
| 23 |
!$omp parallel workshare if (foo () .gt. 2) num_threads (bar () + 1) |
| 24 |
a = 10 |
| 25 |
b = 20 |
| 26 |
a(1:5) = max (a(1:5), b(1:5)) |
| 27 |
!$omp end parallel workshare |
| 28 |
if (any (a(1:5) .ne. 20)) stop 1 |
| 29 |
if (any (a(6:10) .ne. 10)) stop 2 |
| 30 |
if (.not. foo_seen .or. .not. bar_seen) stop 3 |
| 31 |
end |