Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / event01a.f90
blob101131542d0b1700f79d4b9fb14d4f0358d5ba7d
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
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 non_event[*], sync_status, co_indexed_integer[*], superfluous_stat, non_scalar(1)
14 character(len=128) error_message, co_indexed_character[*], superfluous_errmsg
15 logical invalid_type
17 !___ standard-conforming statements ___
19 event post(concert)
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
32 !ERROR: expected ')'
33 event post(event=concert)
35 !______ invalid sync-stat-lists: invalid stat= ____________
37 ! Invalid stat-variable keyword
38 !ERROR: expected ')'
39 event post(concert, status=sync_status)
41 ! Invalid sync-stat-list: missing stat-variable
42 !ERROR: expected ')'
43 event post(concert, stat)
45 ! Invalid sync-stat-list: missing 'stat='
46 !ERROR: expected ')'
47 event post(concert, sync_status)
49 !______ invalid sync-stat-lists: invalid errmsg= ____________
51 ! Invalid errmsg-variable keyword
52 !ERROR: expected ')'
53 event post(concert, errormsg=error_message)
55 ! Invalid sync-stat-list: missing 'errmsg='
56 !ERROR: expected ')'
57 event post(concert, error_message)
59 ! Invalid sync-stat-list: missing errmsg-variable
60 !ERROR: expected ')'
61 event post(concert, errmsg)
63 !______ invalid event-variable: redundant event-variable ____________
65 ! Too many arguments
66 !ERROR: expected ')'
67 event post(concert, occurrences(1))
69 ! Too many arguments
70 !ERROR: expected ')'
71 event post(concert, occurrences(1), stat=sync_status, errmsg=error_message)
73 end program test_event_post