| 1 |
! { dg-do run } |
| 2 |
! |
| 3 |
! Run-time test for EVENT_TYPE |
| 4 |
! |
| 5 |
use iso_fortran_env, only: event_type |
| 6 |
implicit none |
| 7 |
|
| 8 |
type(event_type), save :: var[*] |
| 9 |
integer :: count, stat |
| 10 |
|
| 11 |
count = -42 |
| 12 |
call event_query (var, count) |
| 13 |
if (count /= 0) STOP 1 |
| 14 |
|
| 15 |
stat = 99 |
| 16 |
event post (var, stat=stat) |
| 17 |
if (stat /= 0) STOP 2 |
| 18 |
call event_query(var, count, stat=stat) |
| 19 |
if (count /= 1 .or. stat /= 0) STOP 3 |
| 20 |
|
| 21 |
stat = 99 |
| 22 |
event post (var[this_image()]) |
| 23 |
call event_query(var, count) |
| 24 |
if (count /= 2) STOP 4 |
| 25 |
|
| 26 |
stat = 99 |
| 27 |
event wait (var) |
| 28 |
call event_query(var, count) |
| 29 |
if (count /= 1) STOP 5 |
| 30 |
|
| 31 |
stat = 99 |
| 32 |
event post (var) |
| 33 |
call event_query(var, count) |
| 34 |
if (count /= 2) STOP 6 |
| 35 |
|
| 36 |
stat = 99 |
| 37 |
event post (var) |
| 38 |
call event_query(var, count) |
| 39 |
if (count /= 3) STOP 7 |
| 40 |
|
| 41 |
stat = 99 |
| 42 |
event wait (var, until_count=2) |
| 43 |
call event_query(var, count) |
| 44 |
if (count /= 1) STOP 8 |
| 45 |
|
| 46 |
stat = 99 |
| 47 |
event wait (var, stat=stat, until_count=1) |
| 48 |
if (stat /= 0) STOP 9 |
| 49 |
call event_query(event=var, stat=stat, count=count) |
| 50 |
if (count /= 0 .or. stat /= 0) STOP 10 |
| 51 |
end |