49 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! This test checks for semantic errors in sync team statements.3! Some of the errors in this test would be hidden by the errors in4! the test synchronization04a.f90 if they were included in that file,5! and are thus tested here.6 7program test_sync_team8 use iso_fortran_env, only : team_type9 implicit none10 11 integer sync_status, co_indexed_integer[*], superfluous_stat, non_scalar(1), not_a_team12 character(len=128) error_message, co_indexed_character[*], superfluous_errmsg13 logical invalid_type14 type(team_type) warriors15 16 !___ non-standard-conforming statements ___17 18 !ERROR: Team value must be of type TEAM_TYPE from module ISO_FORTRAN_ENV19 sync team(not_a_team)20 21 !ERROR: Must have INTEGER type, but is LOGICAL(4)22 sync team(warriors, stat=invalid_type)23 24 !ERROR: Must be a scalar value, but is a rank-1 array25 sync team(warriors, stat=non_scalar)26 27 !ERROR: Must have CHARACTER type, but is LOGICAL(4)28 sync team(warriors, errmsg=invalid_type)29 30 !ERROR: The stat-variable in a sync-stat-list may not be repeated31 sync team(warriors, stat=sync_status, stat=superfluous_stat)32 33 !ERROR: The errmsg-variable in a sync-stat-list may not be repeated34 sync team(warriors, errmsg=error_message, errmsg=superfluous_errmsg)35 36 !ERROR: The stat-variable in a sync-stat-list may not be repeated37 sync team(warriors, stat=sync_status, errmsg=error_message, stat=superfluous_stat)38 39 !ERROR: The errmsg-variable in a sync-stat-list may not be repeated40 sync team(warriors, stat=sync_status, errmsg=error_message, errmsg=superfluous_errmsg)41 42 !ERROR: The stat-variable or errmsg-variable in a sync-stat-list may not be a coindexed object43 sync team(warriors, stat=co_indexed_integer[1])44 45 !ERROR: The stat-variable or errmsg-variable in a sync-stat-list may not be a coindexed object46 sync team(warriors, errmsg=co_indexed_character[1])47 48end program test_sync_team49