1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! This test checks for semantic errors in event post statements based on the
3 ! statement specification in section 11.6.7 of the Fortran 2018 standard.
5 program test_event_post
6 use iso_fortran_env
, only
: event_type
9 ! event_type variables must be coarrays
10 type(event_type
) non_coarray
12 type(event_type
) concert
[*], occurrences(2)[*]
13 integer non_event
[*], sync_status
, co_indexed_integer
[*], superfluous_stat
, non_scalar(1)
14 character(len
=128) error_message
, co_indexed_character
[*], superfluous_errmsg
17 !___ standard-conforming statements ___
20 event
post(concert
[1])
21 event
post(occurrences(1))
22 event
post(occurrences(1)[1])
23 event
post(concert
, stat
=sync_status
)
24 event
post(concert
, errmsg
=error_message
)
25 event
post(concert
, stat
=sync_status
, errmsg
=error_message
)
27 !___ non-standard-conforming statements ___
29 !______ invalid event-variable ____________________________
31 ! event-variable has an unknown keyword argument
33 event
post(event
=concert
)
35 !______ invalid sync-stat-lists: invalid stat= ____________
37 ! Invalid stat-variable keyword
39 event
post(concert
, status
=sync_status
)
41 ! Invalid sync-stat-list: missing stat-variable
43 event
post(concert
, stat
)
45 ! Invalid sync-stat-list: missing 'stat='
47 event
post(concert
, sync_status
)
49 !______ invalid sync-stat-lists: invalid errmsg= ____________
51 ! Invalid errmsg-variable keyword
53 event
post(concert
, errormsg
=error_message
)
55 ! Invalid sync-stat-list: missing 'errmsg='
57 event
post(concert
, error_message
)
59 ! Invalid sync-stat-list: missing errmsg-variable
61 event
post(concert
, errmsg
)
63 !______ invalid event-variable: redundant event-variable ____________
67 event
post(concert
, occurrences(1))
71 event
post(concert
, occurrences(1), stat
=sync_status
, errmsg
=error_message
)
73 end program test_event_post