1 ! RUN: %python %S/test_errors.py %s %flang_fc1
3 ! This test checks for semantic errors in sync team statements based on the
4 ! statement specification in section 11.6.6 of the Fortran 2018 standard.
7 use iso_fortran_env
, only
: team_type
10 integer sync_status
, co_indexed_integer
[*], superfluous_stat
, non_scalar(1), not_a_team
11 character(len
=128) error_message
, co_indexed_character
[*], superfluous_errmsg
13 type(team_type
) warriors
16 !___ standard-conforming statement ___
19 sync
team(warriors
, stat
=sync_status
)
20 sync
team(warriors
, errmsg
=error_message
)
21 sync
team(warriors
, stat
=sync_status
, errmsg
=error_message
)
23 !___ non-standard-conforming statement ___
25 !______ missing or invalid team-value _____________________
31 sync
team(stat
=sync_status
, errmsg
=error_message
)
33 !______ invalid sync-stat-lists: invalid stat= ____________
36 sync
team(warriors
, status
=sync_status
)
38 ! Stat-variable must an integer scalar
40 sync
team(warriors
, stat
=invalid_type
)
42 ! Stat-variable must an integer scalar
44 sync
team(warriors
, stat
=non_scalar
)
46 ! Invalid sync-stat-list: missing stat-variable
48 sync
team(warriors
, stat
)
50 ! Invalid sync-stat-list: missing 'stat='
52 sync
team(warriors
, sync_status
)
54 !______ invalid sync-stat-lists: invalid errmsg= ____________
56 ! Invalid errmsg-variable keyword
58 sync
team(warriors
, errormsg
=error_message
)
61 sync
team(warriors
, errmsg
=invalid_type
)
63 ! Invalid sync-stat-list: missing 'errmsg='
65 sync
team(warriors
, error_message
)
67 ! Invalid sync-stat-list: missing errmsg-variable
69 sync
team(warriors
, errmsg
)
71 !______ invalid sync-stat-lists: redundant sync-stat-list ____________
73 ! No specifier shall appear more than once in a given sync-stat-list
74 !ERROR: to be determined
75 sync
team(warriors
, stat
=sync_status
, stat
=superfluous_stat
)
77 ! No specifier shall appear more than once in a given sync-stat-list
78 !ERROR: to be determined
79 sync
team(warriors
, errmsg
=error_message
, errmsg
=superfluous_errmsg
)
81 !______ invalid sync-stat-lists: coindexed stat-variable ____________
83 ! Check constraint C1173 from the Fortran 2018 standard
84 !ERROR: to be determined
85 sync
team(warriors
, stat
=co_indexed_integer
[1])
87 ! Check constraint C1173 from the Fortran 2018 standard
88 !ERROR: to be determined
89 sync
team(warriors
, errmsg
=co_indexed_character
[1])
91 end program test_sync_team