[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / event02a.f90
blobf0cba6b63adbd8d2f870875d8ce3caa14ca5bae4
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! This test checks for semantic errors in event wait statements based on the
3 ! statement specification in section 11.6.8 of the Fortran 2018 standard.
5 program test_event_wait
6 use iso_fortran_env, only : event_type
7 implicit none
9 ! event_type variables must be coarrays
10 type(event_type) non_coarray
12 type(event_type) concert[*], occurrences(2)[*]
13 integer threshold, indexed(1), non_event[*], sync_status, co_indexed_integer[*], superfluous_stat, non_scalar(1)
14 character(len=128) error_message, non_scalar_char(1), co_indexed_character[*], superfluous_errmsg
15 logical invalid_type
17 !_______________________ standard-conforming statements ___________________________
19 event wait(concert)
20 event wait(occurrences(1))
21 event wait(concert, until_count=threshold)
22 event wait(concert, until_count=indexed(1))
23 event wait(concert, until_count=co_indexed_integer[1])
24 event wait(concert, stat=sync_status)
25 event wait(concert, until_count=threshold, stat=sync_status)
26 event wait(concert, errmsg=error_message)
27 event wait(concert, until_count=threshold, errmsg=error_message)
28 event wait(concert, stat=sync_status, errmsg=error_message)
29 event wait(concert, until_count=threshold, stat=sync_status, errmsg=error_message)
31 !____________________ non-standard-conforming statements __________________________
33 !_________________________ invalid event-variable ________________________________
35 ! event-variable has an unknown expression
36 !ERROR: expected ')'
37 event wait(event=concert)
39 !_____________ invalid event-wait-spec-lists: invalid until-spec _________________
41 ! Invalid until-spec keyword
42 !ERROR: expected ')'
43 event wait(concert, until_amount=threshold)
45 ! Invalid until-spec: missing until-spec variable
46 !ERROR: expected ')'
47 event wait(concert, until_count)
49 ! Invalid until-spec: missing 'until_count='
50 !ERROR: expected ')'
51 event wait(concert, threshold)
53 !_________________ invalid sync-stat-lists: invalid stat= ________________________
55 ! Invalid stat-variable keyword
56 !ERROR: expected ')'
57 event wait(concert, status=sync_status)
59 ! Invalid sync-stat-list: missing stat-variable
60 !ERROR: expected ')'
61 event wait(concert, stat)
63 ! Invalid sync-stat-list: missing 'stat='
64 !ERROR: expected ')'
65 event wait(concert, sync_status)
67 !________________ invalid sync-stat-lists: invalid errmsg= _______________________
69 ! Invalid errmsg-variable keyword
70 !ERROR: expected ')'
71 event wait(concert, errormsg=error_message)
73 ! Invalid sync-stat-list: missing 'errmsg='
74 !ERROR: expected ')'
75 event wait(concert, error_message)
77 ! Invalid sync-stat-list: missing errmsg-variable
78 !ERROR: expected ')'
79 event wait(concert, errmsg)
81 !______________ invalid event-variable: redundant event-variable _________________
83 !ERROR: expected ')'
84 event wait(concert, occurrences(1))
86 !ERROR: expected ')'
87 event wait(concert, occurrences(1), stat=sync_status, errmsg=error_message)
89 end program test_event_wait